


The first line of input contains an integer ‘T’ denoting the number of test cases.
The next ‘T’ lines represent the test cases.
The first and the only line of each test case contains 4 integers startX,startY,endX, and endY.
For each test case, print true if there is a sequence of moves to transform the starting point into the ending point, otherwise print false.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= ’T’ <= 50
1 <= ’startX’, ’startY’, ’targetX’, ’targetY’ <= 10^9
‘startX’, ’startY’ denotes starting coordinates.
‘endX’, ’endY’ denotes target coordinates.
Time Limit: 1 sec
The key id is to do bfs traversal from (startX, startY) to (targetX, targetY).If it is possible to reach targetX, targetY return true.
The key idea is instead of starting from the source vertex start traversal in opposite direction. From source vertex 2 vertex is reachable (x,x+y) and (x+y,y) but from target vertex, only 1 vertex needed to be traversed.For Ex-(targetX=5,targetY=7.The opposite traversal can be (5,2) and (-2,7) but both coordinates must be greater than 0. Hence only (5,2) is valid.)
Here is the algorithm:
Pair Product Div by K
Pair Product Div by K
Merge Two Sorted Arrays Without Extra Space
Merge Two Sorted Arrays Without Extra Space
Co-Prime
First Digit One
Special Digit Numbers