fork download
  1. #include <string>
  2. #include <iostream>
  3. #include <algorithm>
  4. using namespace std;
  5. int main() {
  6.  
  7. long Limak,Bob;
  8. long years=0;
  9. cin >> Limak >> Bob;
  10. while (Bob >= Limak) {
  11. Limak = Limak * 3;
  12. Bob = Bob * 2;
  13. years++;
  14. }
  15.  
  16. std::cout << years << endl;
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.01s 5288KB
stdin
4
7
stdout
2