Problem: Elections are taking place in Berland. There are candidates participating in the elections, numbered from to . The -th candidate has fans who will vote for him. Additionally, there are people who are undecided about their favorite candidate, let's call them undecided. Undecided people will vote for the candidate with the lowest number.
The candidate who receives the maximum number of votes wins the elections, and if multiple candidates receive the same maximum number of votes, the candidate with the lowest number among them wins.
You found these elections too boring and predictable, so you decided to exclude some candidates from them. If you do not allow candidate number to participate in the elections, all of his fans will become undecided, and will vote for the candidate with the lowest number.
You are curious to find, for each from to , the minimum number of candidates that need to be excluded from the elections for candidate number to win the elections.
Input Format: Each test consists of multiple test cases. The first line contains a single integer () — the number of test cases. The description of the test cases follows.
The first line of each test case contains two integers and (, ) — the number of candidates in the elections and the number of undecided people.
The second line of each test case contains integers () — the number of fans for each candidate.
It is guaranteed that the sum of over all test cases does not exceed .
Output Format: For each test case, output integers, the -th of which should be equal to the minimum number of candidates that need to be excluded from the elections for candidate number to win.
Note: In the first test case:
- If all candidates are allowed, candidate number will receive votes ( undecided person will vote for him), candidate number will receive votes, and candidate number will receive votes. Therefore, candidate number wins (he received the same number of votes as candidate , but his number is lower), so the answer for him is .
- If candidate number is not allowed, his fans will become undecided. Then candidate number will receive votes ( undecided people will vote for him) and candidate number will receive votes. Therefore, candidate number wins (he received the same number of votes as candidate , but his number is lower), so the answer for him is .
- If candidates with numbers and are not allowed, candidate number wins, so the answer for him is .
In the second test case, candidate number will win if candidate number is not allowed to participate.