Beakjoon&프로그래머스/파이썬
[백준/파이썬] 31613번 繰り返し (Repetition)
현장
2024. 5. 5. 16:19
-Code
x = int(input())
n = int(input())
res = 0
while x < n:
res += 1
if x % 3 == 0:
x += 1
elif x % 3 == 1:
x *= 2
elif x % 3 == 2:
x *= 3
print(res)