W. XHXMMMl31IoTWg#^,:&
XHXMMMl31IoTWg#^,:&
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Statement
You are given an array of integers.
The median of an array is the number , where is the array sorted in non-decreasing order. For example, the median of the array is , as in the sorted array , the number at index is , and the median of the array is , as in the sorted array , the number at index is .
You are allowed to choose an integer ( ) and increase by in one operation.
Your task is to find the minimum number of operations required to increase the median of the array.
Note that the array may not necessarily contain distinct numbers.
Format
Input
Each test consists of multiple test cases. The first line contains a single integer ( ) — the number of test cases. Then follows the description of the test cases.
The first line of each test case contains a single integer ( ) — the length of the array .
The second line of each test case contains integers ( ) — the array .
It is guaranteed that the sum of the values of over all test cases does not exceed .
Output
For each test case, output a single integer — the minimum number of operations required to increase the median of the array.
Sample
8
3
2 2 8
4
7 3 3 1
1
1000000000
5
5 5 5 4 5
6
2 1 2 3 1 4
2
1 2
2
1 1
4
5 5 5 5
1
2
1
3
2
1
2
3
ShanghaiTech ACM 炸鱼杯
- 状态
- 已结束
- 规则
- OI
- 题目
- 46
- 开始于
- 2024-12-10 23:00
- 结束于
- 2024-12-15 13:00
- 持续时间
- 110 小时
- 主持人
- 参赛人数
- 112