Find how much the first bear must eat to become strictly heavier than the second bear.
Problem
Two bears have weights and . The first bear wants to be strictly heavier than the second bear. Each year, the first bear gains weight by multiplying its weight by 3, while the second bear gains weight by multiplying its weight by 2.
Your task is to determine the minimum number of years after which the first bear's weight becomes strictly greater than the second bear's weight.
Notes
- In each year, both bears grow simultaneously.
- You only need to output the smallest non-negative integer such that .
Input Format
- The first and only line contains two integers and .
Output Format
- Print one integer: the minimum number of years needed for the first bear to become strictly heavier than the second bear.
Constraints
- The answer fits in a standard integer type.
Example 1
Input
4 7
Output
2
Explanation
After 1 year: and , so the first bear is still lighter. After 2 years: and , so the first bear becomes heavier.
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.