Bob and Alice are two friends, they have an array A consisting of N integers, A1,A2,A3 ..., AN. Alice likes the arrays in which if element X is present it must have exactly X or zero occurrences. So, Bob has decided to convert this array to an array which Alice likes. To do that, he can perform the following two operations:
Find the minimum number of operations Bob has to perform so that array is liked by Alice.
Input format
Output format
Print T lines. For each test case:
Constraints
1≤T≤20000
1≤N≤200000
1≤Ai≤109∀i∈[1,N]
The sum of N over all test cases does not exceed 200000.
According to the defination: 1 should have exactly one or zero occurence, 2 should have two or zero occurences and 3 should have three or zero occurences.
So for three, we have two options, either we remove both occurences or add one occurence, it will be optimal to add one occurence.