13631363 SUSTech Online Judge
Problem 1363 --[Easy II] Yee

1363: [Easy II] Yee

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1489  Solved: 326
[Submit][Status][Web Board]


Yee receives a mysterious letter that only contains integers. He feels that the k-th smallest number is the key to decode the content. However, he is not good at counting. Could you help him to find the k-th smallest number inside the letter?


The first line of the input contains two integers n,k (1 ≤ n ≤ 5*106, 1 ≤ k ≤n).

The second line contains n integers that show the content of the letter, a1, a2, ..., an (0 ≤ ai ≤ 109)


Output one integer indicates the k-th smallest number inside the letter.

Sample Input

5 3
1 4 2 6 8

Sample Output