Given two bears with different weights, determine how many years it takes for the first bear to become strictly heavier than the second if both grow at fixed annual rates.
Problem
Limak and Bob are bears with initial weights and kilograms, respectively, where .
Every year:
- Limak's weight is multiplied by $3$.
- Bob's weight is multiplied by $2$.
Your task is to determine the smallest number of years after which Limak's weight becomes strictly greater than Bob's weight.
Goal
Return that minimum number of years.
Notes
- The weights grow exponentially by fixed factors.
- You may simulate year by year until Limak overtakes Bob.
Input Format
- A single line contains two integers and .
- It is guaranteed that .
Output Format
- Output one integer: the minimum number of years needed for Limak's weight to become strictly greater than Bob's weight.
Constraints
- The answer fits in a 32-bit signed integer.
- A simple simulation is sufficient.
Example 1
Input
4 7
Output
2
Explanation
After 1 year: Limak = 12, Bob = 14. After 2 years: Limak = 36, Bob = 28. Limak becomes strictly heavier in 2 years.
Premium problem context
Unlock deeper context for this problem
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.