Number SequenceTime Limit:2000/1000 MS (Java/Others) Memory Limit:65536/32768 K (Java/Others)Total Submission(s):8030 Accepted Submission(s):1482Problem DescriptionA number sequence is defined as follows:f(1) = 1,f(2) = 1,f(n) = (A * f(n - 1) + B * f

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 01:57:57
NumberSequenceTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission

Number SequenceTime Limit:2000/1000 MS (Java/Others) Memory Limit:65536/32768 K (Java/Others)Total Submission(s):8030 Accepted Submission(s):1482Problem DescriptionA number sequence is defined as follows:f(1) = 1,f(2) = 1,f(n) = (A * f(n - 1) + B * f
Number Sequence
Time Limit:2000/1000 MS (Java/Others) Memory Limit:65536/32768 K (Java/Others)
Total Submission(s):8030 Accepted Submission(s):1482
Problem Description
A number sequence is defined as follows:
f(1) = 1,f(2) = 1,f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.
Given A,B,and n,you are to calculate the value of f(n).
Input
The input consists of multiple test cases.Each test case contains 3 integers A,B and n on a single line (1

Number SequenceTime Limit:2000/1000 MS (Java/Others) Memory Limit:65536/32768 K (Java/Others)Total Submission(s):8030 Accepted Submission(s):1482Problem DescriptionA number sequence is defined as follows:f(1) = 1,f(2) = 1,f(n) = (A * f(n - 1) + B * f
计算有时间限制 2000/1000 毫秒
1