P28944 [洛谷] Boring Water Problem I
提高+
题目描述

Problem Background

The problem setter is too inexperienced and can only come up with such problems, which are slightly challenging in terms of execution time.

Problem Description

DLS loves trees.
However, he doesn't want to create a data structure problem involving trees; he prefers counting trees.

On this day, he wants to create a tree himself. He has $N$ nodes of the tree, labeled from $1$ to $N$. He will connect them with edges. We define two trees as different if and only if a pair of nodes is connected in one tree but not in the other.
He dislikes trees with too many branches, so he wants the maximum degree of any node in this tree to be $M$.

DLS is not very good at science, so he hopes you can help him calculate how many such trees exist.
The answer should be taken modulo $998244353$.

Input Format

A single line containing two integers $N$ and $M$.

Output Format

A single line containing one integer representing the answer.

Sample Input and Output

Sample Input #1

3 2

Sample Output #1

3

Sample Input #2

7 4

Sample Output #2

2520

Notes/Hints

Data Percentage Constraints
$10\%$ $N, M \le 8$
$30\%$ $N, M \le 100$
$50\%$ $N, M \le 500$
$70\%$ $N, M \le 2000$
$100\%$ $2 \le N, M \le 5 \times 10^4$
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 2
样例输出
3