Problems
Given integers
The value of
For the changing
If
r=0 , add 1 toX .If
r=1 , multiplyX by 2.If
r=2 , multiplyX by 3.
Input
Input is provided in the following format.
1 \le X < N \le 100\ 000 X, N are integers.
Output
Print the minimum number of operations required for
Example #1
2
40
4
Example #2
3
4
1
Example #3
20
62
3
Example #4
1
100000
19
Tag
Source
JOI 2024 예선