Advertisement
Egor_1425

Untitled

May 28th, 2024
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. n = int(input())
  2. a = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1]
  3. for i in range(n-1):
  4.     a.append(a[0] + a[1])
  5.     a.append(a[0] + a[1] + a[2])
  6.     a.append(a[1] + a[2] + a[3])
  7.     a.append(a[2] + a[3] + a[4])
  8.     a.append(a[3] + a[4] + a[5])
  9.     a.append(a[4] + a[5] + a[6])
  10.     a.append(a[5] + a[6] + a[7])
  11.     a.append(a[6] + a[7] + a[8])
  12.     a.append(a[7] + a[8] + a[9])
  13.     a.append(a[8] + a[9])
  14.     for j in range(10):
  15.         a.pop(0)
  16.  
  17. print(sum(a))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement