scripts/ege/Проверочная по 0/16.py

10 lines
148 B
Python
Raw Normal View History

2023-05-05 00:45:01 +03:00
def f(n):
if n < 3:
return 1
if n % 2 == 0:
return f(n - 1) + n - 1
return f(n - 2) + 2 * n - 2
print(f(33))