410023: GYM103920 A Truck Driver

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Truck Drivertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

You are a truck driver and have been given $$$n$$$ boxes. Your boss wants to know what the $$$k^{th}$$$ heaviest box weighs.

Input

The first line will contain the integer $$$k$$$ (($$$1 \leq k \leq 10^5$$$). The second line of input will contain $$$n$$$ integers ($$$1 \leq n \leq 10^5$$$) containing the weights of each of the $$$n$$$ boxes. Each box has a weight $$$w$$$ where ($$$1 \leq w \leq 10^5$$$) and all weights are distinct.

Output

Output the $$$k^{th}$$$ heaviest box's weight.

ExamplesInput
4
1 5 3 2
Output
1
Input
1
1 2 3 4 5 6 7
Output
7

加入题单

算法标签: