Convert to permutation
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
You are given an array of size . In one operation, you can choose an index and increase by .
Find the minimum number of operations required to convert the array into a permutation of size . If it is impossible to do so, print .
Note that a permutation of size contains each element from to exactly once.
Input
The first line contains a single integer , denoting the number of test cases.
Each test case consists of multiple lines. The first line of each test case contains the integer — the size of the array. The next line contains integers, the elements of the array .
Output
For each test case, output on a new line, the minimum number of operations required to convert the array into a permutation of size .
If it is impossible to do so, print .
Examples
Input #1
Answer #1
Submissions 125
Acceptance rate 46%