An Orz panda find a very interesting problem. His problem is that x + y = A, x * y = B, where A and B are constant, how to calculate x2+ y2, x3+ y3, …… xn+ yn. Panda wants you to help him solve it. If you can solve it successfully, he’ll summon many small pandas to Orz you.
In this problem, you just need calculate the result of xn + yn . Since the result can be very large, determine the remainder after dividing it by 1000000007.
问题 E: Equation of Orz Pandas
时间限制:1000 ms 内存限制:128 MB提交:112 解决:29
[ 提交][ 状态][ 讨论版]
题目描述
输入
There several test cases, process to EOF, about 200 test cases.
For each test case, one line contains three A, B, n.
0 ≤ A, B ≤ 1000000, 1 ≤ n ≤ 10000.
输出
Print a single integer modulo1000000007.
样例输入
3 2 2
样例输出
5
提示
한국어中文فارسیEnglishไทย
Anything about the Problems, Please Contact Admin:admin
All Copyright Reserved 2010-2024Xidian Programming Contest Online JudgeTEAM
GPL2.02003-2014HUSTOJ ProjectTEAM
Anything about the Problems, Please Contact Admin:admin
All Copyright Reserved 2010-2024Xidian Programming Contest Online JudgeTEAM
GPL2.02003-2014HUSTOJ ProjectTEAM