scripts/ege/13150871/19.py

13 lines
211 B
Python
Raw Normal View History

2023-05-05 00:45:01 +03:00
def f(x, p):
if x >= 41 or p > 3:
return p == 3
s = [f(x + 1, p + 1), f(x + 5, p + 1), f(x * 3, p + 1)]
return any(s)
for s in range(1, 41):
if f(s, 1):
print(s)
break