#P2665. Kth number

    ID: 1562 远端评测题 5000ms 32MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>HDU男生专场公开赛——赶在女生之前先过节(From WHU)

Kth number

Problem Description

Give you a sequence and ask you the kth big number of a inteval.

Input

The first line is the number of the test cases.
For each test case, the first line contain two integer n and m (n, m <= 100000), indicates the number of integers in the sequence and the number of the quaere.
The second line contains n integers, describe the sequence.
Each of following m lines contains three integers s, t, k.
[s, t] indicates the interval and k indicates the kth big number in interval [s, t]

Output

For each test case, output m lines. Each line contains the kth big number.

1 10 1 1 4 2 3 5 6 7 8 9 0 1 3 2
2