Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = int(input())
- min = 9999999
- def funct(n, now, i, stat, min):
- if now > n:
- return 0
- min = 0
- if now == n:
- if min > i:
- min = i
- return min
- i += 1
- if stat:
- now *= 2
- else:
- now += 2
- funct(a, now, i, False, min)
- funct(a, now, i, True, min)
- c = funct(a, 1, 0, True, 9999999)
- b = funct(a, 1, 0, False, 9999999)
- if c > b:
- print(b)
- else:
- print(c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement