Reach The Point
Suppose there is a grid consisting of an infinite number of cells and you are standing on cell (0,0).
Let your move strength be K which is initially set to 1.
In one move you can perform the following operations:
Find and print the minimum number of moves to reach the destination cell represented by (a,b).
Input
Each test contains multiple test cases. The first line contains the number of test cases t(1≤t≤10^3). Description of the test cases follows.
The first line and only line of each test case contain two-spaced integers a and b (1≤a,b≤10^9).
Output
Print the minimum moves for each test case in separate lines.
1Example 1
2Example 2
Constraints
Limits and guarantees your solution can rely on.
1 ≤ t ≤ 10^31 ≤ a, b ≤ 10^9