#D5342. Lower Bound
Lower Bound
Lower Bound
For a given sequence which is sorted by ascending order, find the lower bound for a specific value given as a query.
- lower bound: the place pointing to the first element greater than or equal to a specific value, or if there is no such element.
Constraints
- $0 \leq a_0 \leq a_1 \leq ... \leq a_{n-1} \leq 1,000,000,000$
Input
The input is given in the following format.
:
The number of elements and each element are given in the first line and the second line respectively. In the third line, the number of queries is given and the following lines, integers are given as queries.
Output
For each query, print the position () of the lower bound in a line.
Example
Input
4 1 2 2 4 3 2 3 5
Output
1 3 4
inputFormat
Input
The input is given in the following format.
:
The number of elements and each element are given in the first line and the second line respectively. In the third line, the number of queries is given and the following lines, integers are given as queries.
outputFormat
Output
For each query, print the position () of the lower bound in a line.
Example
Input
4 1 2 2 4 3 2 3 5
Output
1 3 4
样例
4
1 2 2 4
3
2
3
5
1
3
4
</p>