Quick Sort


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
Python

Given a sequence of integers of length n and an integer k, please use the quick sort algorithm to find the k-th smallest number in the sequence after sorting it in ascending order.

Input Format

The first line contains two integers n and k.

The second line contains n integers (all integers are in the range 1~109), representing the integer sequence.

Output Format

Output an integer, representing the k-th smallest number in the sequence.

Data Range

1 ≤ n ≤ 100000
1 ≤ k ≤ n

Input Example

5 3
2 4 1 5 3

Output Example

3

Comments

There are no comments at the moment.