Bob's data management teacher has given him an assignment involving an array of 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, . It is guaranteed that is odd.
The next line of input will contain space-separated integers, .
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 , therefore the median is .
Comments