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

建议使用的浏览器:

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

7104:Easy Math Problem

题目描述
You need to calculate $\sum\limits_{i=1}^n\sum\limits_{j=1}^n{\tbinom{i + j}{i} \cdot f(i + j, i)}$, where $f(0, x) = 0, f(1, x) = a,$ and for all $2 \leq m \leq x$, $f(m, x) = b \cdot f(m - 1, x) + c \cdot f(m - 2, x)$, and moreover, for all $m > x$, $f(m, x) = d \cdot f(m - 1, x) + e \cdot f(m - 2, x)$.

In mathematics, the binomial coefficients are the positive integers that occur as coefficients in the binomial theorem. Commonly, a binomial coefficient is indexed by a pair of integers $n \geq k \geq 0$ and is written $\tbinom {n}{k}$. It is the coefficient of the $x^k$ term in the polynomial expansion of the binomial power $(1 + x)^n$, and is given by the formula

$$\binom{n}{k} = \frac{n!}{k!(n-k)!}$$
输入解释
This problem contains multiple test cases.

The first line contains an integer $T(1 \leq T \leq 50)$ indicating the number of test cases.

The next $T$ lines each contains six integers $n, a, b, c, d, e(1 \leq n \leq 10 ^ 5, 1 \leq a, b, c, d, e \leq 10 ^ 6)$.
输出解释
Output $T$ lines, each line contains an integer indicating the answer.

Since the answer can be very large, you only need to output the answer modulo $998244353$.
输入样例
2
3 1 1 1 1 1
2 1 2 3 4 5
输出样例
316
482

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

源链接: HDU-7104

最后修改于 2021-10-23T19:11:28+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000/5000MS(Java/Others) 262144/262144K(Java/Others)