Anyone who goes to wlmac knows that the classroom numbers are not in order, and the students need a program that shows them where their classroom is.

More specifically, given an array of N numbers (1 <= N <= 10^5) which represents the hallway of classrooms, and Q students (1 <= Q <= N), find the 1-based index/position of each student's classroom.

The first line will contain N (The number of classrooms).

The second line will contain N space-separated integers (the classrooms themselves).

The third line will contain Q (The number of students who require classroom finding).

The fourth line will contain Q space-separated integers (each student's classroom number, which you are required to locate the position of).

For each student, print the index of that student's classroom's position in the hallway on a separate line

For all cases: each classroom number is within the range (1 <= i <= 10^9). All classroom numbers are guaranteed to be unique.

For 30% of the points, each classroom number is within the range (1 <= i <= 10^5)

`5`

20 8 1 3 10

1

10

`5`

Explanation for Sample Input 1:

The student's classroom (10) is the fifth classroom in the hallway

`8`

30 21 1 200 84 710 911 28

5

21 911 30 28 1

`2`

7

1

8

3

- Points: 5
- Time limit: 3.0s
- Memory limit: 128.0M
- Author: jimmyliu
- Category: Classics
- Type: Implementation
- All Submissions Best Submissions

Comments

- There are no comments.