16953: A โ B
Greedy ๋ฌธ์ ์ด๋ค.
Greedy
์ด๋ฒ ๊ป ๊ฐ๋จํ๋ค.
A, B = map(int, input().split()) cnt = 1 while B > A: if B % 2 == 0: B //= 2 elif B % 10 == 1: B //= 10 else: break cnt += 1 print(cnt if A == B else -1)