Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int a, b, c;
- cin >> a >> b >> c;
- bool flag = false;
- for (int i = 0; i <= c / a; i++) {
- if ((c - i*a) % b == 0) {
- flag = true;
- break;
- }
- }
- flag ? cout << "Yes" : cout << "No";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement