#ds602. 区间lower bound查询
区间lower bound查询
Range Lower Bound Query
Problem Description
You are given numbers and queries:
l r x: among , find the smallest number that is greater than or equal to .
Input Format
The first line contains two integers .
The next line contains integers .
The next lines each contain three integers .
Output Format
For each query, output one number: the answer. If no such number exists, output -1.
Sample Input
5 5
2 4 1 5 3
1 5 6
1 4 3
3 4 3
2 4 2
3 3 1
Sample Output
-1
4
5
4
1