Chef and Chefina are at positions X and Y on a
They both love badminton.
It is known that badminton courts are located at
every integer point.
They want to find a court such that the maximum
distance travelled by either of them is minimized.
Formally, suppose they choose the badminton court at position Z. You need to find the minimum value of max(| X − Z |, | Y- Z |) across all possible choices of Z. Here, |X| denotes absolute value of X.
Report this minimum value.
• The first line of input will contain a single integer T,
denoting the number of test cases.
• Each test case consists of two space-separated
integers X and Y.
For each test case, output the minimum possible
value of max(| X − Z |,| Y − Z |).
• 1 ≤ T ≤ 1000
• 1 ≤ X, Y ≤ 1000
• X ≠ Y
Test case 1: They will choose the court at position 4 in the optimal case where both have to travel a distance of 1 unit.
Test case 2: They can either choose the court at position 6 or position 7. In both the cases one person has to travel a distance of 1 unit.