Advertisement
hkshakib

Untitled

Jul 15th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b, c;
  6. cin >> a >> b >> c;
  7. bool flag = false;
  8. for (int i = 0; i <= c / a; i++) {
  9. if ((c - i*a) % b == 0) {
  10. flag = true;
  11. break;
  12. }
  13. }
  14. flag ? cout << "Yes" : cout << "No";
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement