Saturday, June 30, 2018

M00PAIR - 0 0 Pairs : Classical

#The solution in Python 3 is as follows:


import sys
A = [0, 1]
for _ in range(1000):
A.append(2*A[-2] + A[-1])
for ns in sys.stdin:
print(A[int(ns)-1])


#Keep visiting for more solutions of SPOJ problems in Python 3.Thank you!!!