Binary Search
The array is sorted and has distinct values. For each query value print its 0-based index, or -1 if it's not present. Use binary search — per query.
Input
and the sorted array, then , then query values (one per line).
Output
One answer per line.
Constraints
Sample 1
Input
5 1 3 5 7 9 3 7 4 1
Output
3 -1 0