Kth number

TimeLimit:5000MS  MemoryLimit:32768KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏 | 已有3人收藏了本题
Problem Description

Give you a sequence and ask you the kth small 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 small number in interval [s, t]

Output

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

SampleInput
1 
10 1 
1 4 2 3 5 6 7 8 9 0 
1 3 2
SampleOutput
2
Submit
题目统计信息详细
总AC数63
通过人数35
尝试人数38
总提交量130
AC率26.92%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: