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;
- for (int i = 2; i * i <= c; i++)
- {
- while (c % i == 0)
- {
- num++;
- c /= i;
- }
- }
- if (c != 1)
- num++;
- }
- cout << num << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement