Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- a = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1]
- for i in range(n-1):
- a.append(a[0] + a[1])
- a.append(a[0] + a[1] + a[2])
- a.append(a[1] + a[2] + a[3])
- a.append(a[2] + a[3] + a[4])
- a.append(a[3] + a[4] + a[5])
- a.append(a[4] + a[5] + a[6])
- a.append(a[5] + a[6] + a[7])
- a.append(a[6] + a[7] + a[8])
- a.append(a[7] + a[8] + a[9])
- a.append(a[8] + a[9])
- for j in range(10):
- a.pop(0)
- print(sum(a))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement