An array of $n$ distinct integers is given, then $k$ query values. For each query print the 1-based position of that value in the array, or -1 if it is not present, one per line.
Input
Line 1: $n$. Line 2: $n$ distinct integers in $[0, 3000]$. Line 3: $k$. Line 4: $k$ query values.
Output
Print the position (or -1) for each query, one per line.
Example 1
Input
5 3 1 4 2 5 3 4 2 9
Output
3 4 -1
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.