Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8825

Jo'natishlar soni: 714634

Muhokama yozuvlari: 4541

Yangiliklar soni: 98

Yangiliklar izohlari: 1179


So'ngi izohlar

711. Fibonacci Sequence
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB

The Fibonacci sequence is defined as follows:

  • a0 = 0
  • a1 = 1
  • ak = ak-1 + ak-2

   For a given value of n to find the n-th element of an Fibonacci sequence.

   Input

   The only positive integer N (1  N  40).

   Output

   N-th element of the Fibonacci sequence.

Samples

Input

Output

1

2
1

2

5
5

3

8
21

 

Tayyorladi: Azat Yusupov
Text from: e-olimp.com
Mening urinishlarim(0) Muhokama (0) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(160) Barcha urinishlar(265)