//数论,判断两数是否互质
#include <cstdio>
#include <iostream>

using namespace std;

int gcd(int a, int b) {
return b ? gcd(b, a%b) : a;
}

int main() {
int t;
scanf ("%d", &t);
while (t--) {
int n, m;
scanf ("%d%d", &m, &n);
if (gcd(n, m) == 1) printf ("NO\n");
else printf ("YES\n");
}
return 0;
}

 

编辑器加载中...

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2021-11-19
猜你喜欢
  • 2021-12-08
  • 2021-07-29
  • 2021-07-17
  • 2021-12-24
  • 2022-12-23
  • 2021-05-18
  • 2022-01-07
相关资源
相似解决方案