#P2098. Kth Query
Kth Query
题目描述
点击查看pdf
MianKing has a sequence and he wants to answer queries about it.
Let denote the K-th smallest number of sequence which satisfies that .
Now for each query, give you , you need to answer .
输入格式
The first line has two integers .
The second line has integers which denote .
Then there are lines, the i-th line has three integers which represents the i-th query.
输出格式
There are lines, the i-th line has one integer which denotes .
样例
3 3
1 2 3
0 4 1
0 4 2
0 4 3
0
1
2
5 4
0 1 2 3 4
2 3 4
4 5 1
2 2 3
1 4 5
3
0
2
5
提示
Form 2020ICPC济南站