#CCBCHHAI0000006. Ít nhất một lần nhân ba (Multiply by Three at Least Once)
Ít nhất một lần nhân ba (Multiply by Three at Least Once)
Multiply by Three at Least Once
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Given positive integers , each pass replaces by and increments a counter. Perform at least one pass even if initially. Stop when the updated and output the number of passes.
Input
One line contains positive integers in this order.
Output
Print the number of times multiplication by three was performed.
Subtasks
- Subtask 1 (20%): .
- Subtask 2 (30%): .
- Subtask 3 (50%): , .
Examples
Example 1
Input
3 20
Output
2
Explanation
Pass 1: 3 becomes 9 (<20). Pass 2: 9 becomes 27 (>=20), so output 2.
Example 2
Input
25 20
Output
1
Explanation
Although 25>=20 initially, one multiplication is mandatory; 75>=20 and the answer is 1.