You are given an array of numbers . In one operation, you can pick any index and change to . Given an integer , find the minimum number of operations required to make the mode of the array.
Note: A number is called the mode of the array if it is more frequent than any other number in the array.
Example: The mode of array is . The array does not have any mode.
Input format
Note: Sum of over all test cases does not exceed .
Output format
For each test case output a line containing the minimum number of operations required to make the mode of array .
Constraints
Sum of over all test cases is less than or equal to
For the first case, we can see that is already the mode of the array.
For the second case, we can choose index and do the operation . The array will be . Now, is the mode of the array.