Problem J. Sequence
时间限制 1 ms
内存限制 256 MB
Let us define a sequence as below
$$\left\{\begin{eqnarray*}
F_1 &=& A \\
F_2 &=& B \\
F_n &=& C\cdot{}F_{n-2}+D\cdot{}F_{n-1}+\left\lfloor\frac{P}{n}\right\rfloor
\end{eqnarray*}\right.$$
Your job is simple, for each task, you should output $F_n$ module $10^9+7$.
输入数据
样例输入
复制
2
3 3 2 1 3 5
3 2 2 2 1 4
样例输出
$ Mathjax font initiator $