Summer Training (4) Fifth Bullet --- number theory (hdu1222) and number theory hdu1222
Summary of the question: after that day, you can say that it is almost A three-inch building.
At last, there was no dead face, but a dead fish eye. There are signs of point recovery. But this guy from Mencius
The words are still a bit reasonable, and the sky will fall... in short, due to the incomplete
Cheng, but Mr. A has not appeared yet, and the head of the FFF regiment will catch you with the seven holy fire orders first.
In addition to low intelligence, mechanized troops can be said to be impeccable.
This is exactly what you need to use to hide from them.
Problem Analysis: first, gcd (n, m) is obtained using the moving phase division. If n> m, gcd (n, m) is one to escape.
Otherwise, it cannot be escaped.
1 # include "cstdio" 2 3 int main () 4 {5 int m, n, t, x; 6 scanf ("% d", & t ); 7 while (t -- & scanf ("% d", & n, & m) 8 {9 while (n % m! = 0) 10 {11 x = m; 12 m = n % m; 13 n = x; 14} 15 if (n> = m) 16 printf ("% s \ n", m = 1? "NO": "YES"); 17 else18 printf ("% s \ n", m = 1? "YES": "NO"); 19} 20 return 0; 21} View Code