atcoder#ABC132C. [ABC132C] Divide the Problems
[ABC132C] Divide the Problems
Score : points
Problem Statement
Takahashi made problems for competitive programming. The problems are numbered to , and the difficulty of Problem is represented as an integer (the higher, the harder).
He is dividing the problems into two categories by choosing an integer , as follows:
- A problem with difficulty or higher will be for ARCs.
- A problem with difficulty lower than will be for ABCs.
How many choices of the integer make the number of problems for ARCs and the number of problems for ABCs the same?
Problem Statement
- is an even number.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of choices of the integer that make the number of problems for ARCs and the number of problems for ABCs the same.
6
9 1 4 4 6 7
2
If we choose or , Problem , , and will be for ARCs, Problem , , and will be for ABCs, and the objective is achieved. Thus, the answer is .
8
9 1 14 5 5 4 4 14
0
There may be no choice of the integer that make the number of problems for ARCs and the number of problems for ABCs the same.
14
99592 10342 29105 78532 83018 11639 92015 77204 30914 21912 34519 80835 100000 1
42685