题号:NC231376
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
Let
)
denote the number of different labeled unrooted undirected trees with

vertices, such that for each

, the shortest path between

contains no vertex with index larger than

.
Now

is input and you need to calculate
%20%5Cpmod%20%7B998244353%7D)
. There are multiple test cases.
Two trees are different if and only if there exist two vertices

such that there is an edge between
)
in one tree and there is no edge between
)
in the other one.
输入描述:
The input contains multiple test cases.
The first line contains the number of test cases
. Description of the test cases follows.
The description of each test case consists of one line containing integers
)
.
输入有多组数据。
第一行一个正整数
)
,表示数据组数。
接下来依次输入每组数据。
对于每组数据,输入为一行两个整数
)
。
输出描述:
For each test case print a line consisting of one single integer
%20%5Cpmod%20%7B998244353%7D)
.
对于每组数据,输出一行一个整数
%20%5Cpmod%20%7B998244353%7D)
,表示答案。
示例1
输入
复制
10
3 1
1 1
3 3
4 2
6 4
6 2
5 2
4 3
6 5
1000000 1000000
输出
复制
3
1
2
8
144
432
50
6
120
595392237