Problem H. Number Sequence
时间限制 1 ms
内存限制 32 MB
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).
输入数据
输出数据
For each test case, print the value of f(n) on a single line.
样例输入
样例输出
$ Mathjax font initiator $