{"raw_statement":[{"iden":"problem statement","content":"Define the **score** of a non-empty integer sequence $x = (x_1, \\ldots, x_n)$ as the number of elements of $x$ that are strictly greater than the average of $x$.\nThat is, the score of $x$ is the count of indices $i$ satisfying $x_i > \\dfrac{x_1+\\cdots+x_n}{n}$.\nYou are given a length-$N$ integer sequence $A = (A_1, \\ldots, A_N)$. Find the maximum score of a non-empty subsequence of $A$.\nThere are $T$ test cases; solve each one.\nDefinition of subsequence A subsequence of $A$ is any sequence obtained by deleting zero or more elements from $A$ and keeping the remaining elements in their original order."},{"iden":"constraints","content":"*   $1\\le T\\le 2\\times 10^5$\n*   $2\\le N\\le 2\\times 10^5$\n*   $1\\le A_i\\le 10^9$\n*   All input values are integers.\n*   The sum of $N$ over all test cases is at most $2\\times 10^5$."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$T$\n$\\text{case}_1$\n$\\vdots$\n$\\text{case}_T$\n\nEach case is given in the following format:\n\n$N$\n$A_1$ $\\cdots$ $A_N$"},{"iden":"sample input 1","content":"3\n5\n2 6 5 7 5\n5\n10 10 10 10 10\n5\n1 10 100 1000 10000"},{"iden":"sample output 1","content":"3\n0\n1\n\nFor the first test case, below are examples of subsequences, their averages, and their scores.\n\n*   $x = (A_1) = (2)$: the average is $2$, and the score is $0$.\n*   $x = (A_3,A_5) = (5,5)$: the average is $5$, and the score is $0$.\n*   $x = (A_1,A_3,A_4,A_5) = (2,5,7,5)$: the average is $\\frac{19}{4}$, and the score is $3$.\n*   $x = (A_1,A_2,A_3,A_4,A_5) = (2,6,5,7,5)$: the average is $5$, and the score is $2$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}