#C1845. Minimum Steps to See Each Other

    ID: 45095 Type: Default 1000ms 256MiB

Minimum Steps to See Each Other

Minimum Steps to See Each Other

In an infinite grid, two robots are positioned at coordinates \( (x_1, y_1) \) and \( (x_2, y_2) \). The robots can see each other if and only if they are in the same row (i.e., \( x_1 = x_2 \)) or in the same column (i.e., \( y_1 = y_2 \)). Otherwise, one of the robots can move exactly one step (horizontally or vertically) to align with the other so that they can see each other.

Your task is to determine the minimum number of steps required for the robots to see each other.

inputFormat

The first line contains an integer \( T \) representing the number of test cases. Each of the following \( T \) lines contains four space-separated integers: \( x_1, y_1, x_2, y_2 \), representing the coordinates of the two robots.

outputFormat

For each test case, output a single integer on a new line which is the minimum number of steps required for the robots to be able to see each other.

## sample
2
0 0 4 0
1 2 1 3
0

0

</p>