fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. int a,b;
  5. cin>>a>>b;
  6. if(a>b){
  7. cout<<0;
  8. return 0;
  9. }
  10. double ans;
  11. ans=log((double)b/(double)a)/log(1.50);
  12. if(a*pow(3,ans) == b*pow(2,ans))
  13. cout<<(int)(ans+1);
  14. else
  15. cout<<int(ans);
  16. }
Success #stdin #stdout 0s 15240KB
stdin
4 7
stdout
2