贝祖定理
通常来说就是给你一个a,b,c;
而使得ax + by = c中存在的结果为当且仅当存在一个m是a,b的最大公约数的倍数。
即a = bx + r1;
例题
#include<iostream>
uisng namespace std;
int x, y, z;
int gcd(){
return y == 0? x: gcd( y, x%y);
}
int main(){
cin >> x >> y >> z;
if(z == 0) cout << false;
else if(x + y < z) cout << true;
else{
if(z % gcd(x,y) == 0) cout << true;
else cout << false;
}
}
谢谢大家