A lab scoreboard holds n marks (values may repeat). You need the k-th lowest mark in sorted order, where duplicates count by multiplicity: if the sorted marks are 2 2 4, then the 1st and 2nd lowest are both 2 and the 3rd lowest is 4.
Report the value that would sit at position k (1-indexed) if the marks were sorted ascending. The intended approach partitions the marks around a pivot and recurses only into the side that contains position k, rather than fully sorting.
Input format
Line 1: two integers n and k.
Line 2: n space-separated integers, the marks.
Output format
A single integer: the k-th lowest mark.
Constraints
- 1 <= n <= 100000
- 1 <= k <= n
- 0 <= each mark <= 1000000000