The legendary competitive programming team Chickémon GO! from South China University of Technology (SCUT) has had a remarkable journey. Half a year ago, at the CCPC Jinan Regional Contest, they unfortunately left without a medal. However, they did not lose heart. After months of rigorous training, they finally won a Silver Medal at the ICPC ECFinal, proving their status as the top team of SCUT. As the poem says, "The light boat has passed ten thousand mountains" — they have overcome countless difficulties to reach this point.
To document this journey of rebirth, the team captain collected $$$n$$$ historical performance indices from their training contests. Each index $$$a_i$$$ represents the difficulty level they overcame in the $$$i$$$-th contest.
They want to set a baseline score $$$x$$$ to summarize their current level. The baseline must satisfy the following conditions:
Note that the sequence can contain equal elements.
Your task is to find such an integer $$$x$$$. If there are multiple valid answers, print the minimum of them. If no such integer exists, print -1.
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 10^4$$$) — the number of test cases.
The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$0 \le k \le n$$$) — the number of historical records and the required count of records less than or equal to the baseline.
The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the historical performance indices.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, print the answer on a separate line.
Print the minimum integer $$$x$$$ in the range $$$[1, 10^9]$$$ such that exactly $$$k$$$ elements of the given sequence are less than or equal to $$$x$$$. If there is no such $$$x$$$, print -1.
3 7 4 8 1 2 2 3 10 11 5 0 1 3 5 7 9 6 6 4 2 7 1 9 3
3 -1 9
| Name |
|---|


