题解 | 小红与gcd三角形
小红与gcd三角形
https://www.nowcoder.com/practice/bc2d5fd2d2094f5989c94e47d5c93332
#include <iostream>
using namespace std;
int main() {
int t;
cin >>t;
int x, y, n, max;
while(t--){
cin >>x >>y;
n = x > y ? x :y;
for(int i = 1; i <=n; i++){
if(x %i == 0 && y %i == 0){
max = i;
}
}
if((x+y) > max&& (x+max) >y &&(y +max) > x){
cout << "Yes"<<endl;
}else{
cout << "No" <<endl;
}
}
}
// 64 位输出请用 printf("%lld")
