#ds304. 异或第k小
异或第k小
XOR k-th Smallest
Problem Description
You are given numbers .
You must answer queries. Each query gives two numbers and , and asks for the -th smallest element among (sorted in ascending order).
Input Format
The first line contains two integers and .
The second line contains integers .
The following lines each contain two numbers and (), representing one query.
Output Format
Output lines in total, each containing one integer: the -th smallest value for that query.
Sample Input
5 5
11 10 6 4 14
15 1
11 4
3 5
6 1
9 1
Sample Output
1
13
13
0
2
Constraints
For of the test data: , .