程序设计在线评测(Online Judge)


问题 1031. -- Sum of Fibonacci Sequence

1031: Sum of Fibonacci Sequence

时间限制: 1 Sec  内存限制: 128 MB
提交: 165  解决: 106
[提交][状态][讨论版]

题目描述

The Fibonacci sequence of numbers is known: F1 = 1; F2 = 1; Fn+1 = Fn + Fn-1, for n>1. You have to find SUM(K) - the sum of the first K Fibonacci numbers.

输入

Each line contains a natural number K (0<K<38).

输出

For each case, output SUM(K) in one line. You may assume the result will be in the range of 32-bit signed integer

样例输入

5
9

样例输出

12
88

提示

参考例3.20

来源

[提交][状态][讨论版]