二元一次方程 a*x+b*y=n,n为a,b的最大公约数的整数倍即有解
附ac代码:
#include <stdio.h>
int main(){
int t, a, b, n, x;
scanf("%d", &t);
while(t-- && scanf("%d%d%d", &a, &b, &n)){
while(b){
x = a % b;
a = b;
b = x;
}
if(n % a) printf("No\n");
else printf("Yes\n");
}
return 0;
}