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