Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f():
- s = input().split(' ')
- x = int(s[0])
- y = int(s[1])
- res = 0
- while y != x and res < 101:
- if abs(y - x - 3) >= abs(y - 4*x):
- if (x + 12 == x * 4) or x*4 == y:
- x*=4
- else:
- x+=3
- else:
- x+=3
- res+=1
- if res == 101:
- print(-1)
- if res < 101:
- print(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement