Memorization을 포함하는 Top-Down Dynamic Programming 방법
def fi(n, l):
if n == 1 or n == 2:
return 1
if l[n]:
return l[n]
else:
l[n] = fi(n-1, l) + fi(n-2, l)
return l[n]
n = int(input())
l = [0]*41
print(fi(n, l))
l = [0,1]+[0]*39
n = int(input())
for i in range(2, n+1):
l[i] = l[i-1] + l[i-2]
print(l[n])