Chef made two laddus with sweetness X and Y respectively. Cheffina comes and sees the chef created two laddus with different sweetness (might be same). Cheffina has the magical power to make the sweetness of laddus equal. Cheffina requires 1 unit of power to increase the sweetness of laddu by its original value i.e. 1 unit to convert Z to 2Z and 2 unit to convert Z to 3Z and so on… How many units of power does cheffina want to make the sweetness equal?

-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input, two integers $X, Y$. 

-----Output:-----
For each test case, output in a single line answer as power required.

-----Constraints-----
- $1 \leq T \leq 10^5$
- $1 \leq X,Y \leq 10^5$

-----Sample Input:-----
2
2 2
4 6

-----Sample Output:-----
0
3

-----EXPLANATION:-----
For 1) Sweetness are same so no need to use power.
For 2) 
1st laddu
2 Unit power = 4 -> 12
2nd Laddu
1 Unit power = 6 -> 12
After using total 3 unit power sweetness of both laddus are same.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'from collections import Counter\r\nimport string\r\nimport math\r\nimport sys\r\n# sys.setrecursionlimit(10**6) \r\ndef isprime(x): \r\n      \r\n    # check for numbers from 2 \r\n    # to sqrt(x) if it is divisible \r\n    # return false \r\n    i = 2\r\n    while(i * i <= x): \r\n        if (x % i == 0): \r\n            return 0\r\n        i+=1\r\n    return 1\r\ndef isSumOfKprimes(N, K): \r\n      \r\n    # N < 2K directly return false \r\n    if (N < 2 * K): \r\n        return 0\r\n  \r\n    # If K = 1 return value depends \r\n    # on primality of N \r\n    if (K == 1): \r\n        return isprime(N) \r\n  \r\n    if (K == 2): \r\n          \r\n        # if N is even directly \r\n        # return true; \r\n        if (N % 2 == 0): \r\n            return 1\r\n  \r\n        # If N is odd, then one  \r\n        # prime must be 2. All  \r\n        # other primes are odd \r\n        # and cannot have a pair \r\n        # sum as even. \r\n        return isprime(N - 2)\r\n      \r\n  \r\n    # If K >= 3 return true; \r\n    return 1\r\nfrom math import pow, floor \r\n  \r\nres = 0\r\ndef checkRecursive(num, x, k, n): \r\n    nonlocal res \r\n    if (x == 0): \r\n        res += 1\r\n      \r\n    r = floor(pow(num, (1 / n))); \r\n  \r\n    for i in range(k + 1, r + 1, 1): \r\n        a = x - int(pow(i, n)) \r\n        if (a >= 0): \r\n            checkRecursive(num, x - int(pow(i, n)), i, n) \r\n    return res \r\n  \r\n# Wrapper over checkRecursive() \r\ndef check(x, n): \r\n    return checkRecursive(x, x, 0, n) \r\nfrom fractions import Fraction\r\ndef array_int():\r\n    return [int(i) for i in sys.stdin.readline().split()]\r\ndef vary(arrber_of_variables):\r\n    if arrber_of_variables==1:\r\n        return int(sys.stdin.readline())\r\n    if arrber_of_variables>=2:\r\n        return list(map(int,sys.stdin.readline().split())) \r\ndef makedict(var):\r\n    return dict(Counter(var))\r\ntestcases=vary(1)\r\nfact=[1 for i in range(11)]\r\nfor i in range(1,10):\r\n    fact[i]=fact[i-1]*i\r\nfor _ in range(testcases):\r\n    n,k=vary(2)\r\n    if n==k:\r\n        print(0)\r\n        continue\r\n    print(((n*k)//math.gcd(n,k))//n+((n*k)//math.gcd(n,k))//k-2)\r\n    \r\n   \r\n    \r\n        \r\n\r\n    \r\n    \r\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: