## GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

## [Solution] Change Row and Column Both CodeChef Solution

There is a $10×10$ grid with rows numbered $1$ to $10$ from top to bottom, and columns $1$ to $10$ from left to right. Each cell is identified by a pair $\left(r, c\right)$ which means that the cell is located at row $r$ and column $c$.

If Chef's current location is $\left(a,b\right)$, then in one move Chef can go to $\left(c,d\right)$ if both of the following are satisfied:

• $a\ne c$
• $b\ne d$
Solution Click Below:-  👉
👇👇👇👇👇

Determine the minimum number of moves required to go from $\left({s}_{x},{s}_{y}\right)$ to $\left({e}_{x},{e}_{y}\right)$.

### Input Format

• The first line contains a single integer $T$ — the number of test cases. Then the test cases follow.
• The first and only line of each test case contains four integer ${s}_{x}$${s}_{y}$${e}_{x}$${e}_{y}$ — the coordinates of

•  the starting and ending cells.

### Output Format

For each testcase, output the minimum number of moves required to go from $\left({s}_{x},{s}_{y}\right)$ to $\left({e}_{x},{e}_{y}\right)$.

### Constraints

• $1\le T\le 1000$
• $1\le {s}_{x},{s}_{y},{e}_{x},{e}_{y}\le 10$