Skip to content

Commit 33df280

Browse files
committed
atcoder/abc060B
1 parent 8f7872a commit 33df280

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

atcoder/abc060/B/main.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
using ll = long long;
5+
6+
bool solve(int A, int B, int C) {
7+
for (int i = 1; i < 1000; ++i) {
8+
if ((A * i) % B == C) return true;
9+
}
10+
return false;
11+
}
12+
13+
int main() {
14+
ios_base::sync_with_stdio(false);
15+
cin.tie(0); cout.tie(0);
16+
17+
int A, B, C;
18+
cin >> A >> B >> C;
19+
auto ans = solve(A, B, C) ? "YES" : "NO";
20+
cout << ans << endl;
21+
22+
return 0;
23+
}

0 commit comments

Comments
 (0)