#GYM104669G. No Anime
No Anime
Description
Keys loves watching anime. Unfortunately, his friend Tortles does not. Currently, the two of them are on an infinite grid. In every second, Keys will move one tile (either directly north, south, east, or west) and Tortles will move two tiles (any valid path such that the manhattan distance equals $0$ or $2$). Keys always moves before Tortles (even though they move in the same second, Keys will take his turn first, and then when he is finished moving, Tortles will move.) When Keys moves, he will leave behind an anime poster in the location he last was. Tortles' job is to stop Keys. If Tortles walks onto a tile with an anime poster, he will remove it from the grid.
Assuming both Tortles and Keys moves optimally, output the minimum number of moves for Tortles to pick up all of the posters Keys leaves behind and also tag Keys by moving onto the same tile he is on after he has picked up all of the posters.
Keys and Tortles start in distinct locations, and the grid starts empty (free of anime posters).
The first line contains one integer $T (1 \le T \le 100)$, denoting the number of tests. Afterwards, $T$ lines follow. Each line contains four space-separated integers $X_1$ $Y_1$ $X_2$ $Y_2$, where $X_1$ and $Y_1$ represents the starting location of Tortles, and $X_2$ and $Y_2$ represents the startling location of Keys $(1 \le X_1, Y_1, X_2, Y_2 \le 10^9)$.
Output $T$ lines, with each line containing a single integer representing the minimum number of moves for Tortles to catch Keys while picking up all the posters.
Input
The first line contains one integer $T (1 \le T \le 100)$, denoting the number of tests. Afterwards, $T$ lines follow. Each line contains four space-separated integers $X_1$ $Y_1$ $X_2$ $Y_2$, where $X_1$ and $Y_1$ represents the starting location of Tortles, and $X_2$ and $Y_2$ represents the startling location of Keys $(1 \le X_1, Y_1, X_2, Y_2 \le 10^9)$.
Output
Output $T$ lines, with each line containing a single integer representing the minimum number of moves for Tortles to catch Keys while picking up all the posters.
1
1 1 1 2
1
Note
Keys when he has a single second of free time: