You are given an grid. You can go from point to any point of grid if and only if is not equal to and is not equal to and their Euclidian distance is an integer value. You have to tell whether you can go from the top left point to the bottom right point using any number of valid moves.
The first line of input contains a single integer , the number of test cases..
For each test case, there are two integers and .
For each test case, print “Case X: S”, where “X” is the case number. “S” will be “YES” if it is possible to go from the top left cell (,) to the bottom right cell (,), and “NO” otherwise.
Input | Output |
---|---|
2 1 1 2 2 | Case 1: YES Case 2: NO |
Euclidean distance between two points coordinates (,) and (,) is given by