Perry and Doof have \(a\) and \(b\) chocolates respectively (where \(a > b\)). Doof has a special device Moduloinator in which he can set the value of \(M\) between \(1\)and \(a\). And when he pushes the button, the number of chocolates that Perry has becomes \(a \,{mod}\, M\).Specifically new value of \(a\) becomes \(a \,{mod}\, M\).
He can use the device as many times as he wants, and also he can change the value of \(M\) every time.
Is Doof’s device useful enough to exactly equalize the chocolates of him and Perry?
Input Format
-
First-line contains integer \(T\), the number of test cases.
-
Next \(T\) lines contain two integers \(a\) and \(b\).
Output Format
-
For every test case output, the minimum number of times Doof needs to use the device to equalize the chocolates or print \(-1\) if not possible.
Constraints
-
\(1 \leq T \leq 10\)
- \(1 \leq b < a \leq 10^6\)