CF450B.Jzzhu and Sequences
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Jzzhu has invented a kind of sequences, they meet the following property:
You are given x and y , please calculate fn modulo 1000000007 (109+7) .
输入格式
The first line contains two integers x and y (∣x∣,∣y∣<=109) . The second line contains a single integer n (1<=n<=2⋅109) .
输出格式
Output a single integer representing fn modulo 1000000007 (109+7) .
输入输出样例
输入#1
2 3 3
输出#1
1
输入#2
0 -1 2
输出#2
1000000006
说明/提示
In the first sample, f2=f1+f3 , 3=2+f3 , f3=1 .
In the second sample, f2=−1 ; −1 modulo (109+7) equals (109+6) .