AtCoder Beginner Contest 079
翻译中…
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.
翻译中…
样例
Input #1
5
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$.
Input #2
86
Output #2
939587134549734843
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。