P11040 [CodeChef] cd1it1
NOI
题目描述

Given an array A[1..N] of N non-negative integers, you need to find the median of the array.
The median of an array is the middle element in its sorted order. If N is even, choose the (N/2)^th element in the sorted order.

Input
The first line contains N, the number of integers in the array.
The next line has N integers, the elements in the array

Output
In a single line, output the median of the array.

Constraints

1 <= N <= 10^5
0 <= Ai <= 10^6

Example 1

Input
5
9 34 1 290 32

Output
32

Explanation
The sorted order is [1, 9, 32, 34, 290]. The middle element is 32

Example 2

Input
6
17 13 10 1 3 1

Output
3

Explanation
The sorted order is [1, 1, 3, 10, 13, 17]. The (N/2)^th element is 3.

输入格式

见题面

输出格式

见题面

样例输入
6 17 13 10 1 3 1
样例输出
3