#arc162a. [arc162_a]Ekiden Race
[arc162_a]Ekiden Race
Problem Statement
There are people, numbered from to , who participated in a round-trip race between two points. The following information is recorded about this race.
- The outward times of any two people were different, and person had the -th fastest outward time.
- The round-trip times (the sum of the outward and return times) of any two people were different, and person had the -th fastest round-trip time.
- The person (or persons) with the fastest return time was awarded the fastest return award.
Here, is a permutation of .
How many people could have received the fastest return award?
There are test cases. Answer each of them.
Constraints
- is a permutation of .
- All input values are integers.
- The sum of over all test cases in a single input is at most .
Input
The input is given from Standard Input in the following format:
Each test case, , is given in the following format:
Output
Print lines. The -th line should contain the answer for the -th test case.
Sample Input 1
3
2
2 1
4
1 2 3 4
20
13 2 7 1 5 9 3 4 12 10 15 6 8 14 20 16 19 18 11 17
Sample Output 1
1
4
7
- In the first test case, two people participated in the race, and person overtook person on the return leg. In this case, the fastest return award is awarded to person .
- In the second test case, the rankings did not change on the return leg, so any person could have received the fastest return award.