Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- long long x , a, b, z, y, c;
- cin >> a >> b;
- z = a;
- x = 1000000000000;
- while (z > 1)
- {
- z = a; y = b;
- while (y)
- {
- c = z % y;
- z = y;
- y = c;
- }
- a /= z;
- b /= z;
- }
- if (a % b)
- {
- if (x % b)
- {
- cout << "NO" << endl;
- }
- else
- {
- cout << "YES" << endl;
- }
- }
- else
- {
- cout << "YES" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement