There are candidates and the voluntary team only needs several volunteers in total. To ensure the quality of the team, they decided to hold an election to pick out the volunteers. Every resident has to nominate exactly
candidates and mustn't give more than one nomination to each candidate. (of course one can save one of the nominations for himself/herself). The candidates then will be ranked by the nominations they get in descending order, if there are candidates have the same number of nominations, they will be ranked by their names in lexicographically increasing order.
The input consists of several test cases. The first line of the input is an integer
, the number of the test cases.
For each test case, the first line will be two integers
. The number of candidates and the number of nominations that each resident can make.
The next line will be
integers
separated by spaces, which are the current number nominations of each candidate. The first integer always refers to the nominations of ZZZZSGW.
For each test case,
,
. And there is
for all test cases.
For each test case, output a single integerin a line, which is the best place ZZZZSGW can get after his turn.
There are more hidden rules in the election than you think, so don't be surprised that the sum of nominations can't be divided by. (Well, such hidden rules won't take effect on ZZZZSGW's turn, please don't worry.)