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



Sample input:
5


Sample output:
11

Submission status: Runtime Error

Solution code:
a=input()
x=2
y=1
for i in range(a-1):
    z=x+y
    x=y
    y=z

print z

Submission status: Runtime Error

Solution code:
#!/user/bin/python
# coding: UTF-8

N = int(raw_input())

L = [2, 1]
flag = 0
i = 0
while flag == 0:
    l = 0
    l = L[i] + L[i + 1]
    L.append(l)
    i = i + 1
    print l
    if l > 86:
        flag = flag + 1

print L[N]

Submission status: Runtime Error

Solution code:
# coding: utf-8
import math


def test(n,dict):
    left = n - 1
    right = n - 2
    leftValue = 0
    rightValue = 0
    if left in dict:
        leftValue = dict[left]
    else:
        leftValue = test(left, dict)

    if right in dict:
        rightValue = dict[right]
    else:
        rightValue = test(right, dict)


    return leftValue + rightValue



if __name__ == "__main__":
    n = int(input())
    dict = {0:2, 1:1}
    print(test(n, dict))

Submission status: Runtime Error

Solution code:
 N = int(input())


 def fibn(a, b, k, n):
     if k < n:
         return fibn(b, a+b, k+1, n)
     else:
         return a+b

 print(fibn(2,1,2,N))

Submission status: Runtime Error

Solution code:
import functools
 
 
@functools.lru_cache()
def f(n):
    if n == 0:
        return 2
    elif n == 1:
        return 1
    else:
        return f(n-1)+f(n-2)
 
print(f(int(input())

Submission status: Runtime Error

Solution code:
N = int(input())

L0, L1 = 2,1

for _ in range(N-1):
  L = L0 + L1
  L0, L1 = L1, L
print(L)

Submission status: Runtime Error

Solution code:
N = int(input())

L0, L1 = 2,1

for _ in range(N-1):
  L = L0 + L1
  L0 = L1
  L1 = L
print(L)

Submission status: Runtime Error

Solution code:
def L(n):
    a = 2
    b = 1
    for i in range(n - 1):
        res = 0
        res += a + b
        a = b
        b = res
    return res
print(L(int(input())))

Submission status: Runtime Error

Solution code:
N = int(input())
l = 2
r = 1
for i in range(N - 1):
    L = l + r
    l = r
    r = L
print(L)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

if __name__ == '__main__':
    N = input()
    n0 = 2
    n1 = 1
    if N == 1:
        print(1)
    now = 1
    while now != N:
        n = n0 + n1
        n0 = n1
        n1 = n
        now += 1
    print(n)

Submission status: Runtime Error

Solution code:
#!usr/bim/python
#! -*- coding: utf-8 -*-

n = raw_input()
n = int(n)

b2 = 2
b1 = 1

for i in range(n-1):
    a = b1 + b2
    b2 = b1
    b1 = a
    #print i+2, a

print a

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from sys import stdin
a = [2,1]
for i in xrange(80):
 a.append(a[-1] + a[-2])
print a[int(stdin.readline())]