#P1720. 月落乌啼算钱(斐波那契数列)
月落乌啼算钱(斐波那契数列)
Description
After paying, Yue Luo Wu Ti thought, "You ripped me off!" So when Ai Yu Chou asked how much it cost, Yue Luo Wu Ti replied with a bunch of gibberish. Ai Yu Chou said, "Forget it, I only ask: what is the price of the -th dish?" Yue Luo Wu Ti wrote:
$$F_n=\dfrac{\left(\frac{1+\sqrt{5}}{2}\right)^n-\left(\frac{1-\sqrt{5}}{2}\right)^n}{\sqrt{5}}$$Since Ai Yu Chou had studied programming, he computed in minute. Yue Luo Wu Ti was shocked. Can you, like Ai Yu Chou, compute the value of ?
Input Format
One line containing a non-negative integer .
Output Format
One line containing a real number , with two decimal places.
6
8.00
Hint
For all testdata: .
Translated by ChatGPT 5
京公网安备 11011102002149号