You are given a pair of integersand an integer .
You can change the pair in two different ways:
- set (assign) ;
- set (assign) ,
whereis the absolute difference between and .The pair is called -magic if is obtainable either as or as using only the given operations (i.e. the pair is -magic if or after some number of operations applied). You can apply the operations any number of times (even zero).
Your task is to find out if the pairis -magic or not.
You have to answerindependent test cases.
Input X-Magic Pair solution codeforces
The first line of the input contains one integer( ) — the number of test cases. The next lines describe test cases.
The only line of the test case contains three integers, and ( ).
For the YES if the corresponding pair is -magic and NO otherwise.-th test case, print
Example X-Magic Pair solution codeforces
8 6 9 3 15 38 7 18 8 8 30 30 30 40 50 90 24 28 20 365 216 52 537037812705867558 338887693834423551 3199921013340
YES YES YES YES NO YES YES YES