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

建议使用的浏览器:

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

7232:Shattrath City

题目描述
$\space \space$**Why would a *prophet* not warn of calamity?*

$\space \space$**Why didn't you warn the world about the Cataclysm?* The simple, logical question of a mortal child echoed accusingly throughout the silent chamber, distracting the Prophet from his contemplation of the Light. Velen had evaded rather than answered, obscured instead of illuminating. He was surprised at himself. *Am I still capable of deception? Even after all this time? Both within and without?*

$\space \space$**Velen is sinking in self-doubt.*


Velen calls a sequence "$n$-beautiful", if it satisfies the following three conditions:

1. Its length is larger than $n$.
2. Each element of the sequence is a positive integer $\leq n$.
3. Each of its **continuous** subsequence of length $n$ is **NOT** a permutation of $1,2...n$.

Velen takes inspiration from "$n$-beautiful" sequences, so he is interested in the number of "$n$-beautiful" sequences of length $m$.

Could you help him?

Since the answer can be very large, you only need to output the answer **modulo 998244353**.
输入解释
The input consists of multiple test cases.

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

Each test case consists of only one line containing two integers $n,m\ (3\leq n < m \leq 2\times 10^5)$.
输出解释
For each test case, output one line containing one integer indicating the answer.
输入样例
3
3 5
5 10
100000 200000
输出样例
123
8001745
700646201

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

源链接: HDU-7232

最后修改于 2022-09-15T06:17:31+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 524288/524288K(Java/Others)