There is one box labeled with each integer from $$$1$$$ to $$$N$$$. Also, for each integer from $$$1$$$ to $$$N$$$, there are $$$M$$$ balls labeled with that integer.
These $$$NM$$$ balls are shuffled and then distributed into the $$$N$$$ boxes, with exactly $$$M$$$ balls placed into each box.
There are $$$\frac{(NM)!}{(M!)^N}$$$ possible ways to place the balls (if all balls are considered distinguishable), and all of these arrangements occur with equal probability.
You will perform operations on these boxes and balls. One operation consists of the following steps.
Define your score as the number of operations required until all $$$NM$$$ balls have been discarded. You want to minimize this score.
Find the expected value of the score when you act optimally, modulo $$$998244353$$$.
The first line contains $$$N$$$ and $$$M$$$ in this order, separated by spaces. ($$$1\leq N\leq 10^5$$$, $$$1\leq M\leq 100$$$)
Print the answer.
2 2
166374060
3 1
831870296
100000 100
402978825
For the first example, the possible ball arrangements and the corresponding optimal ways of operating are as follows.
In summary, the minimum score is $$$2$$$ with probability $$$1/6$$$, and the minimum score is $$$1$$$ with probability $$$5/6$$$, so the expected score overall is $$$7/6$$$. Therefore, output $$$166374060$$$, which represents this value modulo $$$998244353$$$.
It can be proven that the expected value to be found is always a rational number. Also, under the constraints of this problem, if the expected value is written as a reduced fraction $$$\frac{y}{x}$$$, it is guaranteed that $$$x$$$ is not divisible by $$$998244353$$$.
In this case, there exists a unique integer $$$z$$$ between $$$0$$$ and $$$998244352$$$, inclusive, satisfying $$$xz \equiv y \pmod{998244353}$$$. Output this $$$z$$$.
| Name |
|---|


