After a night of incessant substance abuse, Pickle Rick must reach his spacecraft as soon as possible to leave the planet, as his insolence has earned him half a dozen dangerous enemies. Pickle Rick is a pickle, and we can consider his shape to be that of a cuboid with dimensions $$$1\times 1\times 2$$$. He is standing on the cell $$$(0, 0)$$$ of an infinite grid of $$$1\times 1$$$ cells. When we say he is standing, we mean that he is resting on either of his two square faces with dimensions $$$1\times 1$$$.
His spacecraft is located at position $$$(x, y)$$$ on the grid, and he wants to reach it standing up and in the least number of moves. To move, Pickle Rick chooses one of his edges in contact with the ground and rotates around it until he touches the ground again. For example, from his initial position, he can rotate around the right edge to lie flat on the cells $$$(1, 0)$$$ and $$$(2, 0)$$$ and then rotate again around the right edge to stand on cell $$$(3, 0)$$$. This is a total of two moves.
Due to his state of inebriation, Pickle Rick does not reason clearly. Help him. You must calculate the minimum number of moves he must make to reach the cell where his spacecraft is located while standing.
The input starts with an integer $$$t$$$, the number of cases. This is followed by $$$t$$$ lines, one for each case, with the coordinates $$$x$$$ and $$$y$$$ of the cell where the spacecraft is located.
For each case, print a line with a single integer: the minimum number of moves that Pickle Rick must make to reach his spacecraft while standing.
$$$1\leq t\leq 10^5$$$
10 points: $$$0\leq x, y \lt 1000$$$ and both are multiples of $$$3$$$
20 points: $$$0\leq x, y \lt 10$$$
20 points: $$$0\leq x, y \lt 100$$$
40 points: $$$0\leq x, y \lt 1000$$$
10 points: $$$0\leq x, y \lt 10^9$$$
3 0 0 3 1 0 2
0 3 4