问题2462--Sleepy Kaguya

2462: Sleepy Kaguya

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

题目描述

Houraisan☆Kaguya is the princess who lives in Literally House of Eternity. However, she is very playful and often stays up late. This morning, her tutor, Eirin Yagokoro was going to teach her some knowledge about the Fibonacci sequence. Unfortunately, the poor princess was so sleepy in class that she fell asleep. Angry Eirin asked her to complete the following task:
This sequence can be described by following equations:
1.F[1]=F[2]=1
2.F[n]=F[n-1]+F[n-2] (n>2)
Now, Kaguya is required to calculate F[k+1]*F[k+1]-F[k]*F[k+2] for each integer k that does not exceed 10^18.
Kaguya is so pathetic. You have an obligation to help her.
(I love Houraisan Kaguya forever!!!)

输入

Only one integer k.

输出

Only one integer as the result which is equal to F[k+1]*F[k+1]-F[k]*F[k+2].

样例输入

2

样例输出

1

提示

F[2]=1,F[3]=2,F[4]=3
2*2-1*3=1
PS:
0 < k ≤ 1e18
If necessary, please use %lld when you use "scanf", or just use "cin" to get the cases.


来源/分类


[提交] [状态]