Lower Median
Print the lower median: the element at position ⌈N/2⌉ when the values are sorted (1-based).
Input: the first line has N; the second line has N integers.
Output: the lower median.
Constraints:
- 1 ≤ N ≤ 105
- −109 ≤ ai ≤ 109
Sample Tests
Input 1
5 7 1 5 9 3
Output 1
5
Input 2
4 4 1 3 2
Output 2
2
Discussion (opens after you solve — no spoilers before)
No comments yet.