#abc169e. [abc169_e]Count Median
[abc169_e]Count Median
Problem Statement
There are integers , and we know that . Find the number of different values that the median of can take.
Notes
The median of is defined as follows. Let be the result of sorting in ascending order.
- If is odd, the median is ;
- if is even, the median is .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2
1 2
2 3
Sample Output 1
3
-
If and , the median is ;
-
if and , the median is ;
-
if and , the median is ;
-
if and , the median is .
Thus, the median can take three values: , , and .
Sample Input 2
3
100 100
10 10000
1 1000000000
Sample Output 2
9991