Skip to content

Instantly share code, notes, and snippets.

@nukopy
Created November 26, 2018 07:11
Show Gist options
  • Save nukopy/e43035481fe1827773a34d8c9f990c46 to your computer and use it in GitHub Desktop.
Save nukopy/e43035481fe1827773a34d8c9f990c46 to your computer and use it in GitHub Desktop.
ABC060 B - Choice Intergers
#include <iostream>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
for (int i = 1; i <= B; ++i) {
if (A*i%B == C) {
cout << "YES" << "\n";
return 0;
}
}
cout << "NO" << "\n";
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment