
Let 'X' = 3 and 'Y' = 6, Alice adds 1 to 'X' since 'X' is odd. Now 'X' will become 4. Then, Alice will add 2 to 'X', since 'X' is even, and it will become 6. 'X' becomes equal to 'Y'. Hence we will return 1 as the answer.
The first line contains an integer 'T', which denotes the number of test cases.
For every test case:-
The first line contains two integers, 'X' and 'Y', the variables mentioned above.
For each test case, Return 1 if 'X' can be made equal to 'Y' using the above operations any number of times(possibly 0) and 0 otherwise.
You don’t need to print anything. Just implement the given function.
1 <= 'T' <= 10
1 <= 'X', 'Y' <= 10^9
Time Limit: 1 sec
Approach:-
If 'x' > 'y', 'x' can never be made equal to 'y'.
If 'y' is even, we can always make 'x' equal to 'y' by performing some number of operations.
If 'y' is odd, Let's take two cases:
So, when 'y' is odd, it is impossible to make 'x' equal to 'y' except if 'x' is already equal to 'y'.
Algorithm:-