Problem 1118 --K-th1118: K-th
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 793 Solved: 251
[Submit][Status][Web Board]Description
David has many numbers, and he wants to know the K-th biggest number among them.
Input
The first line will be an integer T, which is the number of the test cases(1 <= T <= 12). For each test case, the first line will be two integers n and K(1 <= n <= 5*105, K <= 5000 or K >= 0.99n). The second line will be n integers, a1……an(1 <= ai <= 109).
Output
For each test output the K-th biggest element in one line.
Sample Input
1
10 1
1 2 3 4 5 6 7 8 9 10
Sample Output
10
HINT
Source
[Submit][Status]