QOJ.ac

QOJ

حد الوقت: 1.0 s حد الذاكرة: 256 MB مجموع النقاط: 100 قابلة للهجوم ✓

#8149. 命运之站

الإحصائيات

有 $n$ 个人站在 $m$ 个车站中,形成了 $m$ 个队列。

你不知道每个人在哪个车站,也不知道他们排队的顺序,因此你想计算不同方案的数量。当且仅当存在一个车站,其队列中的人不同,或者排队顺序不同时,两个方案被认为是不同的。

计算不同方案的数量,结果对 $998\,244\,353$ 取模。

输入格式

第一行包含一个整数 $T$ ($1 \le T \le 100$),表示测试用例的数量。接下来是 $T$ 个测试用例。

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

输出格式

对于每个测试用例,输出不同方案的数量,结果对 $998\,244\,353$ 取模。

样例

样例输入 1

2
3 2
6 3

样例输出 1

12
7200

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.