Find an element
Very easy
Execution time limit is 3 seconds
Runtime memory usage limit is 128 megabytes
Array of n integers is given. Find its k-th element in decreasing order.
Input
First line contains the number of elements n (1 ≤ n ≤ 10^5
) in array, and integer k(1 ≤ k ≤ 10^5
). Second line contains n integers, not greater than 10^9
by absolute value.
Output
Print the k-th element of array sorted in decreasing order, or -1 if such element does not exist.
Examples
Input #1
Answer #1
Submissions 7K
Acceptance rate 34%