Problem:
 Score : 200 points    Problem Statement It is November 18 now in Japan. By the way, 11 and 18 are adjacent Lucas numbers.  You are given an integer N . Find the N -th Lucas number.  Here, the i -th Lucas number L_i is defined as follows:   L_0=2  L_1=1  L_i=L_{i-1}+L_{i-2} (i≥2)       Constraints  1≤N≤86  It is guaranteed that the answer is less than 10^{18} .  N is an integer.         Input Input is given from Standard Input in the following format:  N       Output Print the N -th Lucas number.        Sample Input 1 5      Sample Output 1 11   L_0=2  L_1=1  L_2=L_0+L_1=3  L_3=L_1+L_2=4  L_4=L_2+L_3=7  L_5=L_3+L_4=11   Thus, the 5 -th Lucas number is 11 .       Sample Input 2 86      Sample Output 2 939587134549734843

Solution (Python):
n = int(input())
l = [2,1]
for i in range(2,n+1):
  a = l[-1]+l[-2]
  l.append(a)
print(l[-1])

Solution (Python):
n=int(input())
for i in range(n+1):
  if i==0:
    a=2
  elif i==1:
    b=1
  else:
    a,b=b,a+b
print(b)

Solution (Python):
n=int(input())
l=[2,1]
while(len(l)<=n):
  l+=[sum(l[-2:])]
print(l[n])

Solution (Python):
N = int(input())
L = [0 for i in range(86+1)]
for i in range(N+1): 
  if(i == 0):
    L[i] = 2
  elif(i == 1):
    L[i] = 1
  else:
    L[i] = L[i-2] + L[i-1]
print(L[N])

Solution (Python):
def luca(num):
  if num == 0:
    return 2
  
  if num == 1:
    return 1
  
  memo[0] = 2
  memo[1] = 1
  
  if memo[num] != 0:
    return memo[num]
  
  memo[num] = luca(num-1) + luca(num-2)
  
  return memo[num]

n = int(input())
memo = [0]*(n+1)
print(luca(n))

Solution (Python):
import sys
n = int(input())
m = [2,1]

if n == 1:
    print(1)
    sys.exit()
    
for i in range(1,n):
    x = sum(m)
    m.append(x)
    del m[0]
print(x)

Solution (Python):
N = int(input())
L = [2, 1]
for _ in range(88):
    L.append(L[-1]+L[-2])
print(L[N])

Solution (Python):
N = int(input())

ryuka = [0] * 100
ryuka[0] = 2
ryuka[1] = 1

for i in range(2, 87):
  ryuka[i] = ryuka[i-1] + ryuka[i - 2]


print(ryuka[N])

Solution (Python):
import sys

n=int(input())
list=[]
if n==1:
	print(1)
	sys.exit()
list.append(2)
list.append(1)
for i in range(2,87):
	list.append(list[i-1]+list[i-2])
	if n==i:
		print(list[-1])
		sys.exit()

Solution (Python):
L = [2,1]
n = int(input())
for i in range(2,n+1):
  L.append(L[i-1]+L[i-2])
print(L[n])

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    l=[]
    l.append(2)
    l.append(1)
    for i in range(85):
        l.append(l[-1]+l[-2])
    print(l[n])
if __name__ == '__main__':
    do()

Solution (Python):
def luc(s,n,l1,l2):
    if(n==s+1):
        print(l1+l2)
        return
    luc(s,n+1,l2,l1+l2)
a=int(input())
if a==1:print(1)
else:luc(a,3,2,1)

Solution (Python):
n = int(input())
cnt = 0

def lucas(n, ans1, ans2):
    if(n >= 2):
        for _ in range(n-1):
            ans = ans1 + ans2
            ans1 = ans2
            ans2 = ans
        return ans
            
    elif(n == 0):
        return 2
    elif(n == 1):
        return 1

print(lucas(n, 2, 1))

Solution (Python):
import math
import string

def intinput():
    return int(input())

def listintinput():
    return list(map(int,input().split()))

def splitintinput():
    return map(int,input().split())

N = intinput()
L = [2,1] 
for i in range(2,87):
    L.append(L[i-1] + L[i-2])

print(L[N])

Solution (Python):
L = [2, 1]
for _ in range(2, 86 + 1):
  L.append(L[-1] + L[-2])

print(L[int(input())])

Solution (Python):
N=int(input())
l=[0]*87
l[0]=2
l[1]=1
for i in range(2,N+1):
    
    l[i]=l[i-1]+l[i-2]
print(l[N])

Solution (Python):
n = int(input())

a = [0] * (n+1)
a[0] = 2
a[1] = 1

for i in range(2, n+1):
    a[i] = a[i-1] + a[i-2]


print(a[n])

Solution (Python):
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys




read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

L=[2,1]
for _ in range(90):
    L.append(L[-1]+L[-2])
N = int(readline())
print(L[N])

Solution (Python):
a,b=2,1
for i in range(int(input())):
  a,b=b,a+b
print(a)

Solution (Python):
def f(n):
  a, b = 2, 1
  if n == 0:
    return a
  if n == 1:
    return b
  for _ in range(n - 1):
    a, b = b, a + b
  return b
print(f(int(input())))

Solution (Python):
import sys
sys.setrecursionlimit(2000)

N = int(input())









L = [0] * (N+1)
L[0] = 2
L[1] = 1
for i in range(2, N+1):
    L[i] = L[i-1] + L[i-2]

print(L[N])

Solution (Python):

n = int(input())
luca = [0] * 88
luca[0] = 2
luca[1] = 1
for i in range(2,87):
    luca[i] = luca[i-1] + luca[i-2]
    
print(luca[n])

Solution (Python):
n=int(input())
l=[2,1]
if n>1:
    for i in range(2,n+1):
        li=l[i-1]+l[i-2]
        l.append(li)
    print(l[n])
else:
    print(l[n])

Solution (Python):
n = int(input())

lucas = 0
prepre = 2
pre = 1

for i in range(n-1):
    lucas = prepre + pre
    prepre, pre = pre, lucas

if n == 1:
    lucas = 1

print(lucas)

Solution (Python):
n=int(input())
if n==0:
    print("2")
elif n==1:
    print("1")
else:
    l=[2,1]
    for i in range(1,n):
        l+=[l[i]+l[i-1]]
    print(l[n])

Solution (Python):
N = int(input())
L = []
L.append(2)
L.append(1)
for i in range(2, N+1):
  L.append(L[i-1]+L[i-2])
print(L[-1])

Solution (Python):
N = int(input())
L0 = 2
L1 = 1

if N == 0:
    print(L0)
elif N == 1:
    print(L1)
else:
    for _ in range(2, N+1):
        L2 = L0 + L1
        L0, L1 = L1, L2
    print(L2)

Solution (Python):

n = int(input())

l = [2, 1]

for i in range(2, n + 1):
    
    l.append(l[i - 1] + l[i - 2])
    
print(l[n])

Solution (Python):
n = int(input())
l = []
l.append(2)
l.append(1)
for i in range(2,87):
  l.append(l[i-1] + l[i-2])
print(l[n])

Solution (Python):
n = int(input())
l = [0]*100
l[0] = 2
l[1] = 1

for i in range(n):
  l[i+2] = l[i+1] + l[i]
  
print(l[n])

Solution (Python):
n = int(input())
L = [0] * (n+1)
L[0] = 2
L[1] = 1
for i in range(2,n+1):
    L[i] = L[i-1] + L[i-2]

print(L[-1])

Solution (Python):
n = int(input())
if n == 0:
    print(2)
else:
    a=2
    b=1
    for i in range(n-1):
        a, b = b, (a+b)
    print(b)

Solution (Python):
N=int(input())
x0=2
x1=1

x=0

if N==1:
    x=1
else:
    for i in range(N-1):
        x=x1+x0
        x0=x1
        x1=x

print(x)

Solution (Python):
n=int(input())
l=[2,1]
for i in range(n-1):
    l.append(l[i]+l[i+1])

print(l[-1])

Solution (Python):
N = int(input())
L = [2,1]+[0]*N
for i in range(2,N+1):
    L[i] = L[i-1] + L[i-2]
print(L[N])

Solution (Python):
def lucas(n):
    l=[2,1]
    i=2
    while(i<=n):
        l.append(l[i-1]+l[i-2])
        i+=1
    return l[-1]

n=int(input())
print(lucas(n))

Solution (Python):

a,b=2,1
for i in range(int(input())):
    a,b,=b,a+b
print(a)

Solution (Python):
l=[2,1]
n=int(input())

for i in range(2,n+1):
    l.append(l[i-1]+l[i-2])
print(l[n])

Solution (Python):
n = int(input())

if n == 0:
  print(2)
elif n == 1:
  print(1)
else:

    l0 = 2
    l1 = 1
    result = 0
    for i in range(n-1):
      result = l0+l1
      l0 = l1
      l1 = result

    print(result)

Solution (Python):
n = int(input())
 
l = [2,1]
for i in range(2,n+1):
  l.append(l[i-1] + l[i-2])
 
print(l[n])

Solution (Python):
N = int(input())

if N == 1:
    print(1)
else:
    L = [0] * (N + 1)
    L[0] = 2
    L[1] = 1
    for i in range(2, N + 1):
        L[i] = L[i - 1] + L[i - 2]
    print(L[N])

Solution (Python):


import numpy as np

dp=[2,1]
for i in range(2,100):
    dp.append(dp[i-1]+dp[i-2])

print(dp[int(input())])

Solution (Python):
n=int(input())
l=[2,1,0]
for i in range(2,n+1):
    l[i%3]=l[i%3-1]+l[i%3-2]
print(l[(n)%3])

Solution (Python):
N = int(input())

l_nums = [2, 1]

for i in range(2, N+1):
    l_nums.append(l_nums[i-2] + l_nums[i-1])

print(l_nums[-1])

Solution (Python):
n = int(input())

l = [2, 1]
for i in range(2, n+1):
   l.append(l[i-2] + l[i-1])
print(l[-1])

Solution (Python):
import sys
input = sys.stdin.readline
def Luka(N) :
    L = [0] * (N + 1)
    L[0] = 2
    L[1] = 1
    for i in range(2,N+1) :
        L[i] = L[i-1] + L[i-2]
    return L[N]
N = int(input())
print(Luka(N))

Solution (Python):
n = int(input())
lucas = []

for i in range(n+1):
    if i == 0:
        lucas.append(2)
    elif i == 1:
        lucas.append(1)
    else:
        lucas.append(lucas[i-1]+lucas[i-2])

print(lucas[n])

Solution (Python):
n = int(input())
l_2 = 2
l_1 = 1
l_now = 1

for _ in range(1,n):
  l_now = l_1 + l_2
  l_2 = l_1
  l_1 = l_now
print(l_now)

Solution (Python):
import sys
input = sys.stdin.readline
n=int(input())
a=[2,1]
for i in range(100):
    a.append(a[-1]+a[-2])
print(a[n])

Solution (Python):
n = int(input())
L = [0] * (n + 1)
for i in range(n + 1):
    if i == 0:
        L[i] = 2
    elif i == 1:
        L[i] = 1
    else:
        L[i] = L[i - 2] + L[i - 1]

print(L[n])

Solution (Python):
l = []
l.append(2)
l.append(1)
def lyuca(n):
  for i in range(n):
    l.append(l[i]+l[i+1])
  return l[n]

print(lyuca(int(input())))

Solution (Python):
N = int(input())
mylist=[]

for i in range(N+1):
    if i==0:
        mylist.append(2)
    elif i==1:
        mylist.append(1)
    else:
        a=0
        a=mylist[-1]+mylist[-2]
        mylist.append(a)
print(mylist[-1])

Solution (Python):
a, b = 2, 1
n = int(input())
for i in range(n):
  a, b = b, (a+b)
print(a)

Solution (Python):
N = int(input())
L = [2, 1]
for i in range(2, N+1):
  L.append(L[i-1] + L[i-2])
print(L[N])

Solution (Python):
k,l=-1,2
for i in [0]*int(input()):k,l=l,k+l
print(l)

Solution (Python):
k,l=-1,2
for i in range(int(input())):k,l=l,k+l
print(l)

Solution (Python):
n=int(input())
k,l=2,1
for i in range(n-1):
    k,l=l,k+l
print(l)

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
L = [2, 1]
for i in range(90):
    L.append(L[-1] + L[-2])
print(L[N])

Solution (Python):
n = int(input())
l = [0]*(n+1)
l[0] = 2
l[1] = 1

if n == 1:
    print(1)
else:
    for i in range(2, n+1):
        l[i] = l[i-1] + l[i-2]
    print(l[-1])

Solution (Python):
n=int(input())
k,l=2,1
for i in range(n-1):
    m=l
    l=k+l
    k=m
    
print(l)

Solution (Python):
n=int(input())
a,b,c=2,1,3
for i in range(n):
    a,b,c=b,c,(b+c)
print(a)

Solution (Python):
N = int(input())
Ln = [2, 1]
for i in range(N-1):
  Ln.append(Ln[i]+Ln[i+1])
  
print(Ln[N])

Solution (Python):
N = int(input())
L = [0] * 90
L[0], L[1] = 2, 1
for i in range(2, len(L)):
    L[i] = int(L[i - 1]) + int(L[i - 2])
print(int(L[N]))

Solution (Python):


n = int(input())

ryuka = [2, 1]

for i in range(2, n+1):
    ryuka.append(ryuka[i-1]+ryuka[i-2])

print(ryuka[-1])

Solution (Python):
a, b = 2, 1
for i in range(int(input())-1):
    a, b = b, a+b
print(b)

Solution (Python):
N = int(input())
L = [2, 1]
for i in range(2, N + 1):
    L.append(L[-1] + L[-2])
print(L[-1])

Solution (Python):

 
import math
import itertools
import sys
import copy
 



N = int(input())

dp = [0 for _ in range(N+1)]
dp[0] = 2
dp[1] = 1


for i in range(2, N+1) :
  dp[i] = dp[i-1] + dp[i-2]

print (dp[N])

Solution (Python):

import functools
@functools.lru_cache()

def lucas(n):
 if n == 0:
  return 2
 elif n == 1:
  return 1
 else:
  return lucas(n-1) + lucas(n-2)

print(lucas(int(input())))

Solution (Python):
N = int(input())

x = 2
y = 1
for _ in range(N):
    x, y = y, x + y
print(x)

Solution (Python):
n=int(input())
a=[2,1]
if n==1:
  print(1)
else:
  for i in range(1,n):
    a.append(a[-1]+a[-2])
  print(a[-1])

Solution (Python):
n = int(input())
lst = [2]

if n==1:
    print(1)
else:
    lst.append(1)
    for _ in range(n-2):
        lst.append(lst[-1]+lst[-2])
    print(lst[-1]+lst[-2])

Solution (Python):

n = int(input())
l = [2,1]
i = 2

while i <= n:
    l.append(l[i-1] + l[i-2])
    i += 1


print(l[-1])

Solution (Python):
n = int(input())
luca = [2, 1]
for i in range(n-1):
    luca.append(luca[-2] + luca[-1])

ans = luca[-1]
print(ans)

Solution (Python):
n = int(input())

lucas = [2,1]

for i in range(n+1):
    if i < 2:
        continue
    else:
        lucas.append(lucas[i-1]+lucas[i-2])

print(lucas.pop())

Solution (Python):
n=int(input())
l=[2,1]
for i in range(2,n+1):
    x=l[i-2]+l[i-1]
    l.append(x)

print(l[n])

Solution (Python):
N = int(input())

L = [0]*(N+1)
L[0]=2
L[1]=1

for i in range(2,N+1,1):
    L[i] = L[i-1] + L[i-2]

print(L[N])

Solution (Python):
a, b = 2, 1
for i in range(int(input())):
  a, b = b, a+b
print(a)

Solution (Python):
def main():
    n=int(input())
    if n==0:
        print(2)
    elif n==1:
        print(1)
    else:
        a=2
        b=1
        for i in range(n-1):
            ans = a + b
            a = b
            b = ans
        print(ans)
main()

Solution (Python):
n = int(input())
a = 2
b = 1

if n==1:
    print(b)
else:
    for i in range(n-1):
        c = a+b
        temp = b
        b = c
        a = temp
    print(c)

Solution (Python):
n = int(input())

L = [2,1]
for _ in range(100):
    L.append(L[-1]+L[-2])
ans = L[n]
print(ans)

Solution (Python):
n = int(input())
a0 = 2
a1 = 1

if n == 1:
    print(1)
else:
    for i in range(n-1):
        a0,a1 = a1,(a0+a1)
    print(a1)

Solution (Python):
n = int(input())

d = [2] * (n + 1)

d[1] = 1

for i in range(2, n + 1):
    d[i] = d[i - 2] + d[i - 1]

print(d[n])

Solution (Python):
n = int(input())
a, b = 2, 1
for i in range(n):
  a, b = b, (a+b)
print(a)

Solution (Python):
n=int(input())
l=[2,1]+(n-1)*[0]

for i in range(2,n+1):
  l[i]=l[i-1]+l[i-2]
print(l[-1])

Solution (Python):





n = int(input())
li = [0 for i in range(100)]
li[0]=2
li[1]=1

for i in range(n-1):
    li[i+2]=li[i+1]+li[i]

print(li[n])

Solution (Python):
N = int(input())
L = [2, 1]
if N >= 2:
  for i in range(N-1):
    L.append(L[i]+L[i+1])
print(L[N])

Solution (Python):
import sys

lucas_nums = [None] * 101
lucas_nums[0] = 2
lucas_nums[1] = 1
for i in range(2, 101):
    lucas_nums[i] = lucas_nums[i-2] + lucas_nums[i-1]

n = int(sys.stdin.readline().rstrip())

def main():
    return lucas_nums[n]

if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
n=int(input())
a,b=2,1
for i in range(n):
    a,b=b,a+b
print(a)

Solution (Python):
N = int(input())

l = []
l.append(2)
l.append(1)
for i in range(2, N+1):
  l.append(l[i-2]+l[i-1])
print(l[N])

Solution (Python):
n = int(input())
x = 2
ans = 1
for i in range(n-1):
  tmp = ans
  ans += x
  x = tmp
print(ans)

Solution (Python):
a=[2,1]
for i in range(90):
  a.append(a[-1]+a[-2])
print(a[int(input())])

Solution (Python):
n = int(input())

prev = 2
ans = 1
for i in range(1, n):
    ans, prev = ans + prev, ans
print(ans)

Solution (Python):
n = int(input())

l = [2,1]
for i in range(100):
    l.append(l[-1] + l[-2])

print(l[n])

Solution (Python):
N = int(input())

L = [2, 1]
for i in range(2, N+1):
    L.append(L[i-1] + L[i-2])
    
print(L[N])

Solution (Python):
n = int(input())
a = 2
b = 1
for i in range(n):
	a, b = b, (a+b)
print(a)

Solution (Python):
N = int(input())
 
L = [2, 1]
for i in range(2, N+1):
    L.append(L[i-1] + L[i-2])
print(L[N])

Solution (Python):
N=int(input())
L=[2,1]

for i in range(2,N+1):
    L.append(L[i-1]+L[i-2])
print(L[N])

Solution (Python):
from functools import lru_cache as cache

@cache(maxsize=None)
def lucas(n):
    return 2 if n == 0 else 1 if n == 1 else lucas(n - 1) + lucas(n - 2)

print(lucas(int(input())))

Solution (Python):
N = int(input())
L = [2, 1]
for i in range(2, N + 1):
    L.append(L[i - 1] + L[i - 2])
print(L[N])

Solution (Python):
L = [2, 1]

N = int(input())
for i in range(N - 1):
    L.append(L[-1] + L[-2])

print(L[-1])

Solution (Python):
def Lucas(n):
    a0, a1 = 2, 1
    if n == 0:
        return a0
    elif n == 1:
        return a1
    else:
        for _ in range(n - 1):
            a1, a0 = a0 + a1, a1
        return a1


print(Lucas(int(input())))

Solution (Python):
n = int(input())
lucas = [2, 1]
for i in range(2, n + 1):
    lucas.append(lucas[i - 1] + lucas[i - 2])
print(lucas[n])

Solution (Python):
n=int(input())
a=[2,1]
for i in range(n-1):
    a.append(a[len(a)-2]+a[len(a)-1])
print(a[len(a)-1])

Solution (Python):

N=int(input())
L=[0]*(N+1)
L[0]=2
L[1]=1
for i in range(1,N):
    L[i+1]=L[i]+L[i-1]
    
print(L[N])

Solution (Python):
N=int(input())
a=2
b=1
for i in range(N):
  a,b=b,a+b
print(a)

Solution (Python):
n = int(input())

i0 = 2
i1 = 1
if n>1:
    for i in range(n-1):
        ans = i0+i1
        i0 = i1
        i1  = ans
if n==0:
    print(2)
elif n==1:
    print(1)
else:
    print(ans)

Solution (Python):
n = int(input())
Num = [2,1]

for i in range(2,87):
    new = Num[i-1] + Num[i-2]
    Num.append(new)

ans = Num[n]
print(ans)

Solution (Python):
n=int(input())
L=[0 for i in range(88)]
L[0]=2
L[1]=1
for i in range(2, n+2):
    L[i]=L[i-1]+L[i-2]
print(L[n])

Solution (Python):
n = int(input())

lucas = [2, 1]
r = 1
for i in range(n - 1):
  i = i + 2
  r = lucas[i-1] + lucas[i - 2]
  lucas.append(r)

print(r)

Solution (Python):
N = int(input())

L = [2, 1]
for i in range(2, N+1):
    L.append(L[i-1] + L[i-2])
    
print(L[N])

Solution (Python):
N=int(input())
L=[2,1]
for _ in range(N-1):
  L.append(L[-1]+L[-2])
  L.pop(0)
print(L[-1])

Solution (Python):
n=int(input())
l=[0]*(n+1)
l[0]=2
l[1]=1
for i in range(2,n+1):
    l[i]=l[i-1]+l[i-2]
print(l[n])

Solution (Python):
n = int(input())
l0 = 2
l1 = 1
if n == 0:
    print(l0)
elif n == 1:
    print(l1)
else:
    for i in range(2,n+1):
        li = l0 + l1
        l0 = l1
        l1 = li
    print(li)

Solution (Python):
n = int(input())
l = [0]*87
l[0] = 2
l[1] = 1
for i in range(2, 87):
    l[i] = l[i - 1] + l[i - 2]
print(l[n])

Solution (Python):
n = int(input())
l = [None] * 87
l[0] = 2
l[1] = 1
for i in range(2,n + 1):
  l[i] = l[i - 2] + l[i - 1]
print(l[n])

Solution (Python):
dp=[-1]*100
dp[0]=2;dp[1]=1
for i in range(2,100):
  dp[i]=dp[i-1]+dp[i-2]

print(dp[int(input())])

Solution (Python):
n = int(input())
l0 = 2
l1 = 1
lis = []
lis.append(l0)
lis.append(l1)

for i in range(2,n+1):
    temp = lis[i-1] + lis[i-2]
    lis.append(temp)

print(lis[n])

Solution (Python):
n=int(input())
dp=[2,1]
for i in range(86):
    dp.append(dp[i]+dp[i+1])
print(dp[n])

Solution (Python):
n=int(input())
l=[2,1]
for i in range(2,n+1):
    x=l[i-2]+l[i-1]
    l.append(x)
print(l[n])

Solution (Python):
N=int(input())
L=[0 for _ in range(N+1)]
L[0]=2
L[1]=1
for i in range(2,N+1):
  L[i]=L[i-1]+L[i-2]
print(L[N])

Solution (Python):
n = int(input())

ls_l = [2, 1]

for i in range(2, n+1):
    ls_l.append(ls_l[i-1] + ls_l[i-2])
    
print(ls_l[n])

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5)
from functools import lru_cache
N = int(input())

@lru_cache(maxsize=None)
def lucas(n):
    if n <= 1:
        return 2 - n
    else:
        return lucas(n - 2) + lucas(n - 1)

print(lucas(N))

Solution (Python):
n = int(input())
dic = {0:2,1:1}

def luca(num):
  if num in dic:
    return dic[num]
  else:    
    dic[num] = luca(num-1) + luca(num-2)
    return dic[num]
  
print(luca(n))

Solution (Python):
n = int(input())
la = 1
lla = 2
for i in range(2, n + 1):
    lla, la = la, lla + la
print(la)

Solution (Python):
n=int(input())
dp=[2,1]
for i in range(n-1):
  dp.append(dp[-1]+dp[-2])
print(dp[-1])

Solution (Python):
N=int(input())
L=[2,1]
for i in range(2,N+1):
    L.append(L[i-2]+L[i-1])

print(L[-1])

Solution (Python):
from functools import lru_cache

@lru_cache(maxsize=1000)
def add(a,b):
  return a + b ;

N = int(input())

ans = [0] * (N+2)
ans[0] = 2
ans[1] = 1

for i in range(N):
    ans[i+2] = add(ans[i],ans[i+1])

print(ans[N])

Solution (Python):
N = int(input())

ans = [0] * (N+2)
ans[0] = 2
ans[1] = 1

for i in range(N):
    ans[i+2] = ans[i] + ans[i+1]

print(ans[N])

Solution (Python):
n = int(input())

L = [0 for i in range(n+1)]
L[0] = 2
L[1] = 1
for i in range(n-1):
    L[i+2] = L[i] + L[i+1]

print(L[-1])

Solution (Python):
n = int(input())

l1 = 2
l2 = 1

if n == 0:
	print(2)
elif n==1:
	print(1)
else:
	for i in range(n-1):
		l3 = l1 + l2
		l1 = l2
		l2 = l3
	print(l3)

Solution (Python):
N = int(input())
l = [0]*(N+1)

for i in range(N+1):
    if i == 0:
        l[i] = 2
    elif i == 1:
        l[i] = 1
    else:
        l[i] = l[i-1] + l[i-2]

print(l[N])

Solution (Python):

N = int(input())
L = [2,1]

if N >= 2:
    for i in range(N-1):
        n = L[i] + L[i+1]
        L.append(n)
print(L[N])

Solution (Python):
N = int(input())

a = 2
b = 1

if N == 0:
    print(2)
elif N == 1:
    print(1)
else:
    for _ in range(N - 1):
        c = a + b
        a, b = b, c

    print(c)

Solution (Python):
L = [2,1]
for i in range(int(input())-1):
    L.append(L[-2]+L[-1])
print(L[-1])

Solution (Python):
def luca(n):
    memo =[0 for _ in range(100)]
    
    memo[0] = 2
    memo[1] = 1
    
    for i in range(n):
        memo[i+2] = memo[i] + memo[i+1]
    
    return memo


n = int(input())
ans = luca(n)

print(ans[n])

Solution (Python):
N = int(input())

l = [2, 1]

for i in range(N-1):
  l.append(l[i]+l[i+1])
  
print(l[-1])

Solution (Python):
N = int(input())

L = [2,1]

for i in range(2,N+1):
    tmp = L[i-1] + L[i-2]
    L.append(tmp)

print(L[-1])

Solution (Python):
n = int(input())
a,b = 2,1
for i in range(n-1):
    a,b = b,a+b
print(b)

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
mod = 10**9+7


N = int(input())

num = [2,1]
for i in range(N):
    num.append(num[-2]+num[-1])

print(num[N])

Solution (Python):


N=int(input())
L=[2,1]+[0]*max(0,N-1)


if N>1:
    for n in range(2,N+1): 
        L[n]=L[n-1]+L[n-2]

print(L[N])

Solution (Python):
N = int(input())

L = [2,1]

for i in range(2,87):
  L_i = L[i-2] + L[i-1]
  L.append(L_i)

print(L[N])

Solution (Python):
a,b=2,1
n=int(input())
for i in range(n):
  a,b=b,a+b
print(a)

Solution (Python):
def calc_lucas_num(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1

    cache = [2, 1]
    lucas_num = 0

    for _ in range(1, n):
        lucas_num = cache[1] + cache[0]
        cache[0], cache[1] = cache[1], lucas_num

    return lucas_num

N = int(input())

print(calc_lucas_num(N))

Solution (Python):
a,b = 2,1

n = int(input())

for _ in range(n-1):
  a,b = b,a+b

print(b)

Solution (Python):
import sys

lucas_nums = [None] * 100
def lucas(n):
    if n == 0:
        return 2
    if n == 1:
        return 1
    if lucas_nums[n]:
        return lucas_nums[n]
    lucas_nums[n] = lucas(n-2) + lucas(n-1)
    return lucas_nums[n]

def main():
    n = int(sys.stdin.readline().rstrip())
    print(lucas(n))

if __name__ == "__main__":
    main()

Solution (Python):
import sys

lucas_nums = [None] * 100
lucas_nums[0], lucas_nums[1] = 2, 1
for i in range(2, 100):
    lucas_nums[i] = lucas_nums[i-2] + lucas_nums[i-1]

def main():
    n = int(sys.stdin.readline().rstrip())
    print(lucas_nums[n])

if __name__ == "__main__":
    main()

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()

    lucas = [2,1]
    for i in range(2,N+1):
        lucas.append(lucas[-1]+lucas[-2])
    print(lucas[-1])
if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
pre=2
post=1
num=3
if n==1:
  print(1)
else:
  for i in range(1,n):
    num=pre+post
    pre=post
    post=num
  print(num)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

def main():
    L=[2,1]
    n=int(input())
    for x in range(2,n+1):
        L.append(L[x-1]+L[x-2])
    print(L[n])

main()

Solution (Python):
n=int(input())
l=[0]*(n+1)
l[0]=2
l[1]=1

for i in range(2,n+1):
  l[i]=l[i-1]+l[i-2]
print(l[n])

Solution (Python):
n = int(input())
a= [0]*87
a[0]=2
a[1]=1
for i in range(2,87):
    a[i]=a[i-1]+a[i-2]

print(a[n])

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())

li = [0]*87

li[0] = 2
li[1] = 1

for i in range(2,87):
    li[i] = li[i-1] + li[i-2]

print(li[n])

Solution (Python):
N=int(input())
L=[0]*(N+1)
L[0]=2
L[1]=1
for i in range(N-1):
    L[i+2]=L[i+1]+L[i]
print(L[N])

Solution (Python):
N=int(input())
LLL = []
for i in range(N+1):
    if i==0:
        LLL.append(2)
    elif i==1:
        LLL.append(1)
    else:
        LLL.append(LLL[-1]+LLL[-2])
    

print(LLL[N])

Solution (Python):
l_0 = 2
l_1 = 1
A = int(input())
if A == 0:
  print(l_0)
elif A == 1:
  print(l_1)
else:
  for i in range(A-1):
    if i%2 != 0:
      p = l_1
      l_1 = l_0 + l_1
      l_0 = p
    else:
      p = l_1
      l_1 = l_0 + l_1
      l_0 = p
  print(max(l_0,l_1))

Solution (Python):
N = int(input())
mi = 2
ni = 1
ans = 1
if ans==N:
    print(ni)
    exit()
for i in range(2,N+1):
    ans += 1
    num = ni + mi
    mi = ni
    ni = num
    if ans == N:
        print(num)
        exit()

Solution (Python):
n = int(input())
if n == 1 :
    print(1)
else :
    l = [0] * (n + 1)
    l[0] = 2
    l[1] = 1
    for i in range(2, n+1) :
        l[i] = l[i-1] + l[i-2]
    print(l[n])

Solution (Python):
n = int(input())
l0,l1 = 2,1
if n == 1:
    ans = l1
elif n == 2:
    ans = l0 + l1
else:
    for i in range(1,n):
        ans = l0 + l1
        l0 = ans
        l0,l1 = l1,l0
print(ans)

Solution (Python):
N=int(input())
L1=2
L2=1
l=1
for _ in range(N-1):
    l=L1+L2
    L1=L2
    L2=l
print(l)

Solution (Python):
N = int(input())
luca = [2,1]
cnt = 2
while(cnt <= N):
    L = luca[cnt - 2] + luca[cnt - 1]
    luca.append(L)
    cnt += 1
print(luca[N])

Solution (Python):
n = int(input())
dp = [0 for i in range(100)]
dp[0] = 2
dp[1] = 1
for i in range(2, n+1):
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n])

Solution (Python):
def examB():
    N = I()
    ryuca = [0]*87
    ryuca[0] = 2; ryuca[1] = 1
    for i in range(2,87):
        ryuca[i] = ryuca[i-1] + ryuca[i-2]
    print(ryuca[N])

import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()

Solution (Python):
n = int(input())
L = [0]*(n+1)
L[0] = 2
L[1] = 1
for i in range(2, n+1):
  L[i] = L[i-2] + L[i-1]
  
print(L[n])

Solution (Python):
N=int(input())+1
L_list=[2,1]
if N>=3:
    for i in range(2,N):
        L_list.append(L_list[i-2]+L_list[i-1])
print(L_list[-1])

Solution (Python):
N = int(input())

L = [0]*(N+2)
L[0] = 2
L[1] = 1
for i in range(N):
    L[i+2] = L[i+1]+L[i]
    
print(L[N])

Solution (Python):
n=int(input())
l0=2
l1=1
ln=0
for i in range(n-1):
    ln=l0+l1
    l0=l1
    l1=ln

print(ln if n>1 else 1)

Solution (Python):
n = int(input())
l = [0] * (n + 1)
l[0] = 2
l[1] = 1
for i in range(2, n + 1):
  l[i] = l[i - 2] + l[i - 1]
print(l[n])

Solution (Python):
n=int(input())
x=2
y=1
for i in range(n//2):
    x=x+y
    y=y+x
print(x if n%2==0 else y)

Solution (Python):
N = int(input())
lst = [2,1]

for i in range(86):
    lst.append(lst[i]+lst[i+1])

print(lst[N])

Solution (Python):
n=int(input())
l=[0]*(n+1)
l[0]=2
l[1]=1
for i in range(2,len(l)):
    l[i]=l[i-1]+l[i-2]
print(l[len(l)-1])

Solution (Python):
N = int(input())

L = []
L.append(2)
L.append(1)

for i in range(N-1):
  L.append(L[-1]+L[-2])
  
print(L[-1])

Solution (Python):
N = int(input())
lucass = [0]*87
lucass[0], lucass[1] = 2, 1
for i in range(2, N+1):
	lucass[i] = lucass[i-1] + lucass[i-2]
print(lucass[N])

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
dp = [0] * (N + 1)
dp[0] = 2
dp[1] = 1
for i in range(2, N + 1):
  dp[i] = dp[i - 1] + dp[i - 2]
print(dp[N])

Solution (Python):
n=int(input())
luca=[2,1]
for i in range(n):
  luca.append(luca[i]+luca[i+1])
print(luca[n])

Solution (Python):
n = int(input())
li_2 = 2
li_1 = 1
luca = 0
if n == 0:
    luca = 2
elif n == 1:
    luca = 1
else:
    for i in range(2, n+1):
        luca = li_1 + li_2
        temp = li_2
        li_2 = li_1
        li_1 = luca
print(luca)

Solution (Python):
N = int(input())
memo = [0]*(N+1)
memo[0] = 2
memo[1] = 1
for n in range(2,N+1):
    memo[n] = memo[n-1]+memo[n-2]
print(memo[-1])

Solution (Python):
N = int(input())

L = [2,1]

for i in range(N - 1):
  num = L[-1] + L[-2]
  L.append(num)
  
print(L[-1])

Solution (Python):
N = int(input())
a = 2
b = 1
for _ in range(N-1):
    tmp = a+b
    a = b
    b = tmp
print(b)

Solution (Python):
N = int(input())
a = 2
b = 1
if N == 1:
    print(1)
    exit()
for _ in range(N-1):
    tmp = a+b
    a = b
    b = tmp
print(tmp)

Solution (Python):
n = int(input())
l = [2,1]
for i in range(2,n+1):
    l.append(l[i-1]+l[i-2])
print(l[n])

Solution (Python):
a=2
b=1
for i in range(int(input())):
    a,b = b,a+b
print(a)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
ll = [0] * 90
ll[0] = 2
ll[1] = 1
for i in range(86):
    ll[i+2] = ll[i+1] + ll[i]
print(ll[n])

Solution (Python):
N = int(input())
table = [2,1]
for i in range(2, N+1):
    table.append(table[i-1]+table[i-2])
print(table[N])

Solution (Python):
N = int(input())
L0 = 2
L1 = 1
if N == 0:
    print(L0)
elif N == 1:
    print(L1)
else:    
    for _ in range(N-1):
        L = L1 + L0
        L0 = L1
        L1 = L
    print(L)

Solution (Python):
N = int(input())

L = [0] * (N+1)
L[0] = 2
L[1] = 1

for i in range(2, N+1):
    L[i] = L[i-1] + L[i-2]
print(L[N])

Solution (Python):
N = int(input())

x, y = 1, 2
for _ in range(N-1):
    x, y = x+y, x
print(x)

Solution (Python):
def sol(n):
  if n == 0: return 2
  if n == 1: return 1
  L = [2,1] + [0]*(n-1)
  for i in range(2,n+1):
    L[i] = L[i-2] + L[i-1]
  return L[-1]

print(sol(int(input())))

Solution (Python):
import sys








def main():
    n = int(sys.stdin.readline().rstrip())
    l = [None] * (n + 1); l[0], l[1] = 2, 1
    for i in range(1, n):
        l[i+1] = l[i] + l[i-1]
    print(l[n])

if __name__ == "__main__":
    
    main()

Solution (Python):
N=int(input())
list=[2,1]
for i in range(86):
    list +=[int(list[i])+int(list[i+1])]
print(list[N])

Solution (Python):
n = int(input())
li = [2, 1]
for i in range(2, n + 1):
    li.append(li[i-1] + li[i-2])

print(li[n])

Solution (Python):
N = int(input())
DP = [2, 1]
for i in range(2, N + 1):
  DP.append(DP[i - 1] + DP[i - 2])
print(DP[N])

Solution (Python):
N = int(input())
l0, l1 = 2, 1
ans = 2
for i in range(N):
    ans = l1
    l0, l1 = l1, l0+l1
print(ans)

Solution (Python):
n = int(input())
l = [2,1]
for i in range(2,n+1):
	x = l[i-2] + l[i-1]
	l.append(x)

print(l[n])