Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

GCD Plus LCM

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 ≤ 106) for the number of cases to follow. Next T lines each contain two integers a and b (0 < a, b ≤ 1018).

Output

For each case print “true” or “false” without quotes according to the problem statement.

Sample

InputOutput
3
2 10
2 3
4 6
true
false
false

    Discussion

    Statistics


    63% Solution Ratio

    edge555Earliest, 6M ago

    Wl.ReinoFastest, 0.2s

    moniiitLightest, 5.4 MB

    fffqqqdddShortest, 203B

    Submit

    Login to submit

    Related Contests

    DIU Intra University Programming Contest 2019 Ended at 2019-08-02 08:15:00 +0000 UTC
    Replay of DIU Intra University Programming Contest 2019 Ended at 2019-08-19 16:30:00 +0000 UTC
    Ardent Programmers' Team Practice Contest for ICPC 2019 Ended at 2019-11-01 09:00:00 +0000 UTC