当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5490:Simple Matrix

题目描述
As we know, sequence in the form of $a_n=a_1+(n-1)d$ is called arithmetic progression and sequence in the form of $b_n=b_1 q^{n-1}(q>1, b_1≠0)$ is called geometric progression. Huazheng wants to use these two simple sequences to generate a simple matrix. Here is what he decides to do:
Use the geometric progression as the first row of the simple matrix: $c_{0,n}=b_n$
Use the arithmetic progression as the first column of the simple matrix: $c_{n,0}=a_n$
Calculate the item at $n$-th row, $m$-th column of the simple matrix as $c_{n,m}=c_{n-1,m}+c_{n,m-1}$, where $n≥1$ and $m≥1$.
Given the two sequences, Huazheng wants to know the value of $c_{n,m}$, but he is too busy with his research to figure it out. Please help him to work it out. By the way, you can assume that $c_{0,0}=0$.
输入解释
The first line of input contains a number $T$ indicating the number of test cases ($T≤200$).
For each test case, there is only one line containing six non-negative integers $b_1,q,a_1,d,n,m$. ($0≤n≤10000$). All integers are less than $2^{31}$.
输出解释
For each test case, output a single line consisting of “Case #X: Y”. $X$ is the test case number starting from 1. $Y$ is $c_{n,m}$ module 1000000007.
输入样例
2
3 10 1 1 3 3
5 2 1 10 4 2
输出样例
Case #1: 423
Case #2: 140
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5490

最后修改于 2020-10-25T23:23:07+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 32768/32768K(Java/Others)