You are given an array A of N positive integers. Your task is to add a minimum number of non-negative integers to the array such that the floor of an average of array A becomes less than or equal to K.
The floor of an average of array A containing N integers is equal to ⌊N∑i=1AiN⌋. Here ⌊.⌋ is the floor function. You are given T test cases.
Input format
Output format
For each test case (in a separate line), print the minimum number of non-negative integers that should be added to array A such that the floor of an average of array A is less than or equal to K.
Constraints
1≤T≤101≤N≤2×1051≤A[i]≤1090≤K≤109
In the first test case, we have N=2, K=1, A=[3,1]. The current floor of average of A is ⌊3+12⌋=2>K.
If we add the element 1 to the array, the array becomes [3,1,1]. The floor of average of A is ⌊3+1+13⌋=1≤K. Therefore, the minimum number of non-negative integers we need to add in this case is 1.
In the second test case, we have N=2, K=2, A=[2,1]. The current floor of average of A is ⌊2+12⌋=1≤K. Therefore, we don't need to add any non-negative integer to A.