Chef's favorite game is chess. Today, he invented a new piece and wants to see its strengths.
From a cell , the new piece can move to any cell of the chessboard such that its color is different from that of .
The new piece is currently located at cell . Chef wants to calculate the minimum number of steps required to move it to .
Note: A chessboard is an square board, where the cell at the intersection of the -th row and -th column is denoted . Cell is colored white if is even and black if is odd.
Input Format
- The first line of input contains a single integer denoting the number of test cases. The description of the test cases follows.
- Each test case consists of a single line of input, containing four space-separated integers .
Output Format
For each test case, output a single line containing one integer - the minimum number of moves taken by the new piece to reach from .
Constraints
Sample Input 1
3
1 1 8 8
5 7 5 8
3 3 3 3
Sample Output 1
2
1
0
Explanation
Test Case : and have the same color, so Chef cannot move the new piece in move. Chef can first move the piece from to and then from to , thus taking moves.
Test Case : and have different colors, so Chef can move the piece from to in move.
ConversionConversion EmoticonEmoticon