You are given a sorted array of n integers and q queries. For each query value x, print the smallest 1-indexed position i with a_i >= x. If every element is smaller than x, print n + 1.
The first line has n and q. The second line has n integers in non-decreasing order. The third line has q query values.
Print q integers, one per line.
1 <= n, q <= 200000 |a_i|, |x| <= 10^9
1000 ms256 MB
6 3 1 3 3 5 8 13 3 4 14
2 4 7
The first value >= 3 is at position 2, the first >= 4 is 5 at position 4, and nothing is >= 14.