z-hundred
Little Z decided to "give" you a hundred points for almost nothing. Well, he is giving you a very simple problem.
For given N numbers (1 <= N <= 2000) you have to find the K-th largest one. By that he means that, if you cross-out the duplicates, and sort the items in increasing order, then the K-th element of that array is the K-th largest one
InputFrom the first line of the standard input read two integers integer N and K representing the number of given numbers and the K as explained above. From the next N lines read N integers. Each integer can have up to 1000 digits.
OutputTo the standard output write one integer, the K-th largest one. The solution will always exist
Input:
Output:
3 3
1
3
2Output:
3Input:
Output:
3 2
1111111111111111111111111111111111111111111
4111111111111111111111111111111111111111111
3111111111111111111111111111111111111111111Output:
3111111111111111111111111111111111111111111Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.