GCD Plus LCM

Ardent Programmers' Team...
Limits 1s, 512 MB

In this problem you will be given two integers $a$, $b$. You have to answer if $GCD(a, b) + LCM(a, b) = a+b$ is true or not.

Input

Input begins with an integer $T$ ($0 < T ≤ 10^6$) for the number of cases to follow. Next T lines each contain two integers $a$ and $b$ ($0 < a, b ≤ 10^{18}$).

Output

For each case print $\texttt{true}$ or $\texttt{false}$ without quotes according to the problem statement.

Sample

InputOutput
3
2 10
2 3
4 6
true
false
false

Submit

Login to submit.

Statistics

67% Solution Ratio
edge555Earliest, Aug '19
PROsanto.118026Fastest, 0.0s
PROsanto.118026Lightest, 5.5 kB
rifatrraazzShortest, 168B
Toph uses cookies. By continuing you agree to our Cookie Policy.