{"raw_statement":[{"iden":"problem statement","content":"There are balls with integers from $1$ to $N$ written on them. Specifically, there are $A_i$ balls with integer $i$ ($1 \\leq i \\leq N$) written on them.\nDefine $S=A_1+A_2+\\cdots+A_N$. Here, it is guaranteed that $S$ is a positive even number. Divide the $S$ balls into $S/2$ pairs. The integers written on the two balls in a pair must be different. It can be proved that such pairing is possible under the constraints of this problem.\nFor each pair, perform the following operation:\n\n*   Let the integers written on the two balls be $x$ and $y$ ($x < y$). Replace the numbers written on these balls with $x+0.5$ and $y-0.5$, respectively.\n\nAfter completing the operation for all pairs, let $d$ be the maximum number of balls with the same number written on them. Find the minimum possible value of $d$.\nSolve $T$ test cases for each input."},{"iden":"constraints","content":"*   $1 \\leq T \\leq 125000$\n*   $2 \\leq N \\leq 250000$\n*   $0 \\leq A_i \\leq 10^9$\n*   $S=A_1+A_2+\\cdots+A_N$ is a positive even number.\n*   $A_i \\leq S/2$\n*   The sum of $N$ over all test cases in each input does not exceed $250000$.\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$T$\n$case_1$\n$case_2$\n$\\vdots$\n$case_T$\n\nEach test case is given in the following format:\n\n$N$\n$A_1$ $A_2$ $\\cdots$ $A_N$"},{"iden":"sample input 1","content":"4\n4\n1 2 2 1\n4\n2 2 5 1\n7\n101 2 203 304 5 106 107\n20\n239276621 320064891 910500852 164832983 245532750 198319686 715892722 967824729 769431650 80707349 459924867 257261830 777045523 583882654 950300098 438099970 322288793 532405019 256358887 45539860"},{"iden":"sample output 1","content":"2\n6\n203\n613287276\n\nConsider the first test case. Let $(x,y)$ denote a pair of balls with integers $x,y$ written on them.\nFor example, if we pair as $(1,3),(2,3),(2,4)$, the numbers written on the balls after the operation are $1.5,2.5,2.5,2.5,2.5,3.5$. The maximum number of balls with the same number written on them is $d=4$.\nOn the other hand, if we pair as $(1,2),(2,3),(3,4)$, the numbers written on the balls after the operation are $1.5,1.5,2.5,2.5,3.5,3.5$. The maximum number of balls with the same number written on them is $d=2$.\n$d$ cannot be made smaller than $2$, so the answer is $2$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}