scripts/ege/СР/19.py

13 lines
252 B
Python
Raw Normal View History

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