Sanket being a stud, wants to gift chocolates on "Chocolate Day" to a girl. He has N chocolates of different types. The chocolates are numbered from 1 to N. There are K types of chocolates, numbered from 1 to K. Also, there are infinite chocolates of each type. But, the girl is very demanding. She wants all chocolates of same type.
It takes one minute to change chocolate of one type to another type. Your task is to change some chocolates (possibly zero) so that all chocolates are of same type.
Given the initial types of all the chocolates, find the minimum amount of time you need to fulfill your task.
Sanket asks for your help!
The first line of input contains one integer T denoting the number of test cases.
The first line of each test case contains two space separated integers N and K.
The second line of each test case contains N space separated integers denoting initial types of the chocolates.
Output one integer per line for each test case, the minimum amount of time required to get all chocolates of same type.
*Note : There is no partial scoring for this problem *
We want the third chocolate of type 1 which takes one minute