#GYM104663D. Eating Honey Nuts
Eating Honey Nuts
Description
Seeing recent ads, Mukim got inspired and brought a jar of honey nuts. Honey nuts refer to different types of nuts prepared with honey, usually eaten as a snack. After buying, he did not understand how he would eat them properly because he might eat the whole jar in one go. Luckily he had a regular $N$ sided die, a small cube with each side having a different number written on it, ranging from $1$ to $N$ and has an equal $\frac{1}{N}$ probability of any face to come on top. We play ludo with $6$ sided die.
So, Mukim came up with a plan. He counted that there were $N$ different nuts in the jar numbered from $1$ to $N$. He will roll the dice $K$ times a day and get a number from it. If that numbered nut is still in the jar then he will eat it, otherwise if he won't eat any nut. Now he wants to know the expected number of days until the jar becomes empty.
More formally,
You are given a set that contains number $1\ldots N$. Each day you will do the following operation $K$ times-
- Get a random number in range $1$ to $N$ with equal probability $\frac{1}{N}$. If the number is present in the set then delete it from the set otherwise do nothing.
What is the expected number of days until the set becomes empty.
The expected number of days can be denoted by $\frac{x}{y}$ where $gcd(x, y)=1$. You need to print an integer $z$ satisfying $0\le z < 998244353$ and $z \times y \equiv x$ (mod $998244353$). It can be proved that such $z$ exists and is unique.
Input contains two integers $N$ and $K$ $(1\le N \le 10^5, 1\le K \le 7)$.
The output contains one integer the expected number of days modulo $998244353$.
Input
Input contains two integers $N$ and $K$ $(1\le N \le 10^5, 1\le K \le 7)$.
Output
The output contains one integer the expected number of days modulo $998244353$.
2 1
5 2
3
483277034