scripts/ege/Основная волна. Второй день/23.py
2023-05-05 00:45:01 +03:00

10 lines
188 B
Python
Vendored

def f(n, path):
if n <= 0:
return 0
if n == 1 and 10 in path:
return 1
return f(n - 2, path + [n - 2]) + f(n // 2, path + [n // 2])
print(f(28, []))