QOJ.ac

QOJ

実行時間制限: 2.0 s メモリ制限: 512 MB 満点: 100

#9330. 级数求和

統計

给定两个整数 $k$ 和 $p$。计算 $$\sum_{n=k}^{\infty} \frac{\binom{n}{k}^p}{2^n}$$ 其中 $\binom{n}{k}$ 表示二项式系数,等于 $\frac{n!}{k! \cdot (n-k)!}$。 题目保证结果可以表示为 $\frac{r}{q}$ 的形式,其中 $r$ 和 $q$ 是互质的正整数且 $q \neq 0$。求 $r \cdot q^{-1} \pmod{998\,244\,353}$。

输入格式

第一行包含一个整数 $t$ ($1 \le t \le 2112$),表示测试用例的数量。接下来是各测试用例。 每个测试用例由一行描述,包含两个整数 $k$ 和 $p$ ($k, p \ge 1; p \cdot k \le 10^6$)。 所有测试用例中 $p \cdot k$ 的总和不超过 $10^6$。

输出格式

对于每个测试用例,输出一行,包含整数 $r \cdot q^{-1} \pmod{998\,244\,353}$,即计算结果。

样例

样例输入 1

3
2 3
1 10
9 6

样例输出 1

818
204495126
16726290

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.