Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Bob's data management teacher has given him an assignment involving an array of N numbers. Specifically, he has to find the median of the array, which is defined as the middle element of the array after it has been sorted.

Unfortunately, Bob is too lazy to do the assignment. Please help Bob finish it by finding the median for him.

Input Specification

The first line of input will contain an integer, N (1 \le N \le 10^5). It is guaranteed that N is odd.

The next line of input will contain N space-separated integers, a_1, a_2, ..., a_N (1 \le a_i \le 10^9).

Output Specification

Output one integer, the median of the array.

Sample Input

7
1 9 6 3 5 2 10

Sample Output

5

Explanation for Sample Output

The sorted array is [1, 2, 3, 5, 6, 9, 10], therefore the median is 5.


Comments

There are no comments at the moment.