TopCoder

User's AC Ratio

NaN% (0/0)

Submission's AC Ratio

NaN% (0/0)

Tags

Description

Hard problem always comes with short problem description. But this is an easy problem
with easy description, get start coding now and solve it!
You are given a sequence of integers and a number k, output the kth smallest number.

Input Format

Input contains several test cases, each test case starts with a number n,
1<=n<=1,000,000. Followed by n integers and a number k on a line, 1<=k<=n.

Output Format

For each test case, output the answer on a line by itself.

Sample Input 1

2
1 2 1
5
1 2 3 4 5 3

Sample Output 1

1
3

Hints

Problem Source

Migrated from old NTUJ.

Subtasks

No. Testdata Range Score

Testdata and Limits

No. Time Limit (ms) Memory Limit (VSS, KiB) Output Limit (KiB) Subtasks
0 5000 65536 20