QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 256 MB 總分: 100

#8479. 简单数学题

统计

给定两个正整数 $m$ 和 $n$,求以下公式对 $998\,244\,353$ 取模后的值:

$$\sum_{i=0}^{\lfloor \frac{m}{2} \rfloor} \sum_{j=0}^{\lfloor \frac{n}{2} \rfloor} \binom{i+j}{j}^2 \binom{m+n-2i-2j}{n-2j}$$

其中,$\binom{a}{b}$ 是二项式系数(从 $a$ 个元素的固定集合中选择 $b$ 个元素构成的无序子集的方案数)。

输入格式

第一行包含一个整数 $T$ ($1 \le T \le 10^5$),表示测试用例的数量。

对于每个测试用例,输入为一行,包含两个整数 $m$ 和 $n$ ($1 \le m, n \le 10^5$)。

输出格式

对于每个测试用例,输出一行,包含一个整数:该公式对 $998\,244\,353$ 取模后的值。

样例

样例输入 1

2
1 9
2 6

样例输出 1

30
80

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#852EditorialOpen题解Qingyu2026-01-28 02:24:22View

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.