Codeforces Round 483 (Div. 2) [Thanks, Botan Investments and Victor Shaburov!]
A
Game
Codeforces
800
原题
←B →
翻译中…

Two players play a game.

翻译中…

Initially there are $n$ integers $a_1, a_2, \ldots, a_n$ written on the board. Each turn a player selects one number and erases it from the board. This continues until there is only one number left on the board, i. e. $n - 1$ turns are made. The first player makes the first move, then players alternate turns.

翻译中…

The first player wants to minimize the last number that would be left on the board, while the second player wants to maximize it.

翻译中…

You want to know what number will be left on the board after $n - 1$ turns if both players make optimal moves.

翻译中…

Input

翻译中…

The first line contains one integer $n$ ($1 \le n \le 1000$) — the number of numbers on the board.

翻译中…

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 10^6$).

翻译中…

Output

翻译中…

Print one number that will be left on the board.

翻译中…

Note

翻译中…

In the first sample, the first player erases $3$ and the second erases $1$. $2$ is left on the board.

翻译中…

In the second sample, $2$ is left on the board regardless of the actions of the players.

翻译中…

样例

Input #1
3
2 1 3
Output #1
2
InputCopy OutputCopy
Input #2
3
2 2 2
Output #2
2
InputCopy OutputCopy
题目信息
题号
984A
时间限制
2 s
内存限制
256 MB
标签
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。