#B4121. Seat Interval Calculation
Seat Interval Calculation
Seat Interval Calculation
A hall has 100 seats. The seats are arranged from left to right in the following order:
$$99,97,\ldots,7,5,3,1,0,2,4,6,\ldots,96,98$$
The first 50 seats are the odd numbers in descending order and the last 50 seats are the even numbers in ascending order. Given two different seat numbers a and b, determine how many seats are between them in this arrangement.
Note: If the two seats are consecutive (i.e. no seat between), the answer is 0.
inputFormat
The input consists of a single line containing two different integers a and b separated by a space, representing the seat numbers.
Each seat number is guaranteed to be one of the 100 seats in the hall.
outputFormat
Output a single integer which is the number of seats strictly between seat a and seat b in the given seating order.
sample
99 97
0