题意就是找到找到两个数的最小公倍数等不等于两个数相乘就好了
用GCD的写法就是上面那种感觉自己好弱 摘抄别人的题解
#include<cstdio>
__int64 GCD(__int64 a,__int64 b){
if(a%b==0)
return b;
else
return GCD(b,a%b);
}//GCD求最大公约数
__int64 LCM(__int64 a,__int64 b){
return a*b/GCD(a,b);
}//LCM求最小公倍数
int main(){
int t;
scanf("%d",&t);
__int64 m,n;
while(t--){
scanf("%I64d %I64d",&m,&n);
__int64 k=LCM(m,n);
if(k==m*n)
printf("NO\n");
else
printf("YES\n");
}
return 0;
}