Given an increasing sequence A of
length m.
There are q queries,
each given N, R, calculate:
The second line contains m integers A1,A2,…,Am (1≤A1<A2<⋯<Am<2^17).
Each of the following q lines contains two integers N,
R(1≤N≤10^9, 1≤R≤m).
6 10
2 4 5 6 8 10
5 2
5 1
4 3
8 5
5 2
5 1
10 6
7 6
6 2
8 6
15
10
7
183
15
10
763
84
30
183