Advertisement
Saleh127

Untitled

Apr 18th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. long long a,b,c=0,d,e,f,i,j,k,l;
  6. cin>>a>>b;
  7. while(b%a==0)
  8. {
  9. b/=a;
  10. c++;
  11. }
  12. if(b==1) cout<<"YES\n"<<c-1<<endl;
  13. else cout<<"NO\n";
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement