A. Median
- Giới hạn thời gian
- 1,0 s
- Giới hạn bộ nhớ
- 256 MB
- Điểm
- 1một phần
- Tỉ lệ AC
- 39,6%
- Người giải
- 151
A median in an array with the length of is an element which occupies position number
after we sort the elements in the non-decreasing order (the array elements are numbered starting with
).
We define an expression as the integer part of dividing number
by number
.
Given an array consists of
integers, determine the median of the array.
Input
- The input starts with a positive integer
— the number of test cases. Each test case consists of two lines:
- The first line contains a positive integer
, which represents the number of elements in the array.
- The second line contains
positive integers
, which are the elements of the array.
Output
- For each test case, print a single line containing one integer, which is the median of the array.
Example
Input
2
5
3 4 1 2 5
4
1 6 2 9Output
3
2
Bình luận