Problem: Paprika loves permutations. She has an array . She wants to make the array a permutation of integers to .
In order to achieve this goal, she can perform operations on the array. In each operation she can choose two integers () and (), then perform (that is, replace by the remainder of divided by ). In different operations, the chosen and can be different.
Determine the minimum number of operations needed to make the array a permutation of integers to . If it is impossible, output .
A permutation is an array consisting of distinct integers from to in arbitrary order. For example, is a permutation, but is not a permutation ( appears twice in the array) and is also not a permutation ( but there is in the array).
Input Format: Each test contains multiple test cases. The first line contains a single integer () — the number of test cases. Description of the test cases follows.
The first line of each test case contains an integer ().
The second line of each test case contains integers . ().
It is guaranteed that the sum of over all test cases does not exceed .
Output Format: For each test case, output the minimum number of operations needed to make the array a permutation of integers to , or if it is impossible.
Note: For the first test, the only possible sequence of operations which minimizes the number of operations is:
- Choose , . Perform .
For the second test, it is impossible to obtain a permutation of integers from to .