Given two integers $$$a$$$ and $$$b$$$, you can perform one of the following two operations in each round:
Grace wants to know the minimum number of rounds needed to make both $$$a$$$ and $$$b$$$ become $$$0$$$.
$$$^{\dagger}$$$ $$$\gcd(x, y)$$$ denotes the greatest common divisor of $$$x$$$ and $$$y$$$. For example, $$$\gcd(6, 8) = 2, \gcd(7, 5) = 1$$$. The values of $$$\gcd(x, 0)$$$ and $$$\gcd(0, x)$$$ are defined as $$$x$$$.
Each test file contains multiple test cases. The first line contains the number of test cases $$$T$$$ ($$$1 \leq T \leq 1000$$$). The description of the test cases follows.
Each test case consists of a single line containing two integers $$$a$$$ and $$$b$$$ ($$$1 \leq a \leq b, a \leq 5000, b \leq 10^{18}$$$).
For each test file, it is guaranteed that the sum of $$$a$$$ over all test cases does not exceed $$$10^4$$$.
For each test case, output a single integer representing the minimum number of rounds needed to make both $$$a$$$ and $$$b$$$ become $$$0$$$.
33 412 20114 514
3 4 6
For the first test case in the example, one possible optimal solution is:
| Name |
|---|


