#P1463D. Pairs
Pairs
Description
You have integers . You have to redistribute these elements into pairs. After that, you choose pairs and take minimum elements from them, and from the other pairs, you take maximum elements.
Your goal is to obtain the set of numbers as the result of taking elements from the pairs.
What is the number of different -s () such that it's possible to obtain the set if for each you can choose how to distribute numbers into pairs and from which pairs choose minimum elements?
The first line contains a single integer () — the number of test cases.
The first line of each test case contains the integer ().
The second line of each test case contains integers () — the set you'd like to get.
It's guaranteed that the sum of over test cases doesn't exceed .
For each test case, print one number — the number of different -s such that it's possible to obtain the set .
Input
The first line contains a single integer () — the number of test cases.
The first line of each test case contains the integer ().
The second line of each test case contains integers () — the set you'd like to get.
It's guaranteed that the sum of over test cases doesn't exceed .
Output
For each test case, print one number — the number of different -s such that it's possible to obtain the set .
Note
In the first test case, is the only option: you have one pair and choose the minimum from this pair.
In the second test case, there are three possible -s. If , then you can form the following pairs: , , , , . You can take minimum from (equal to ) and the maximum elements from all other pairs to get set .
If , you can form pairs , , , , and take the minimum elements from , and the maximum elements from the other pairs.
If , you can form pairs , , , , and take the minimum elements from , , .
In the third test case, is the only option: you can form pairs , and take the maximum elements from both of them.