1845: 【CSP函数递归】求1/1+1/2+2/3+3/5+5/8+8/13+13/21……的前n项的和▅

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:3 Solved:3

Description

lns="http://www.w3.org/1998/Math/MathML">1/1+1/2+2/3+3/5+5/8+8/13+13/21+21/34的前 lns="http://www.w3.org/1998/Math/MathML">n 项的和。

Input

输入一个整数 lns="http://www.w3.org/1998/Math/MathML">nlns="http://www.w3.org/1998/Math/MathML">1n30)。

Output

输出一个小数,即前 lns="http://www.w3.org/1998/Math/MathML">n 项之和(保留 lns="http://www.w3.org/1998/Math/MathML">3 位小数)。

Sample Input Copy

20

Sample Output Copy

12.660