You will be given two integers l and r where l ≤ r. There are three functions named F0, F1 and F2.
These functions are described as below:
FUNCTION F0 (ARGUMENT a, ARGUMENT b)
RETURN a × b
END F0
FUNCTION F1 (ARGUMENT l, ARGUMENT r)
IF l == r
RETURN r
END IF
a ← l
b ← F1 (l + 1, r)
c ← F0 (a, b)
RETURN c
END F1
FUNCTION F2 (ARGUMENT l, ARGUMENT r)
x ← r - l + 1
z ← l
y ← x - 1
m ← 2 × z
RETURN (x × (m + y)) / 2
END F2
Let, A = F2(l, r) and B = F1(l, r). Can you determine which one is larger between A and B?
First line of input consists of a single integer T (1 ≤ T ≤ 100000) that denotes the number of test cases. Next T lines are followed by two integers l and r.
If A is larger than B, print “0”. If B is larger than A, print “1”. When it is not possible to determine which one is larger, print “-1”.
Input | Output |
---|---|
1 1 10 | 1 |