题目描述
Problem Description
Mivik mistakenly calculated \((x + y)^2\) as \((x^2 + y^2)\)! Looking at the sky, he saw clouds dispersing and merging, which inspired him to define the \(k\)-th order average of a sequence \(S\) as:
\[
avg_k(S) = \frac{\sum_{i=1}^{|S|} S_i^k}{\left(\sum_{i=1}^{|S|} S_i\right)^k}
\]
Mivik recalls that 2020 was significant due to \(n\) events, such as hosting his first competition, witnessing Porter Robinson's return to the music scene, and meeting someone special. These events are interconnected, forming an undirected graph. Mivik writes down the sizes of all maximal connected components of this graph on a piece of paper, symbolizing his 2020 experiences. Before folding this paper into an airplane, he wants to calculate the \(k\)-th order average of these numbers to commemorate 2020 in his diary.
Unfortunately, Mivik's memory is poor: he remembers \(n\) significant events but forgets their relationships. He asks you to compute the sum of \(k\)-th order averages for all possible scenarios. Mivik is indifferent to the value of \(k\) and only cares about the aesthetic appearance of the final answer in his diary. Thus, he requests you to compute the values for all \(k \in [0, K]\) so he can choose one.
Two scenarios are considered different if there exist two events that are unconnected in one scenario but connected in the other.
Formally, let \(f(G)\) be the set of sizes of all maximal connected components of an undirected graph \(G\). You need to compute for all \(k \in [0, K]\):
\[
\sum_{G \in S(n)} \frac{\sum_{i=1}^{|f(G)|} f(G)_i^k}{\left(\sum_{i=1}^{|f(G)|} f(G)_i\right)^k}
\]
where \(S(n)\) is the set of all undirected graphs with \(n\) vertices. The answer should be modulo \(998244353\).
Input Format
A single line containing two positive integers \(n\) and \(K\), as described in the problem statement.
Output Format
\(K+1\) lines, where the \(i\)-th line contains an integer representing the answer for \(k = i-1\).
Sample Input and Output
Input Sample #1
2 0
Output Sample #1
3
Input Sample #2
3 2
Output Sample #2
13
8
6
Input Sample #3
10 0
Output Sample #3
83728116
Notes/Hints
Sample Explanation
Sample 1: The undirected graphs with two vertices are either connected by an edge or not. For \(k = 0\), the answer is \(\frac{1^0 + 1^0}{(1 + 1)^0} + \frac{2^0}{(2)^0} = 1 + 2 = 3\).
Sample 2: There are 8 undirected graphs with three vertices.
For \(k = 0\), the answer is \(\frac{1^0 + 1^0 + 1^0}{(1 + 1 + 1)^0} + 3 \times \frac{1^0 + 2^0}{(1 + 2)^0} + 4 \times \frac{3^0}{(3)^0} = 3 + 3 \times 2 + 4 \times 1 = 13\);
For \(k = 1\), the answer is \(\frac{1^1 + 1^1 + 1^1}{(1 + 1 + 1)^1} + 3 \times \frac{1^1 + 2^1}{(1 + 2)^1} + 4 \times \frac{3^1}{(3)^1} = 1 + 3 \times 1 + 4 \times 1 = 8\);
For \(k = 2\), the answer is \(\frac{1^2 + 1^2 + 1^2}{(1 + 1 + 1)^2} + 3 \times \frac{1^2 + 2^2}{(1 + 2)^2} + 4 \times \frac{3^2}{(3)^2} = \frac{1}{3} + 3 \times \frac{5}{9} + 4 \times 1 = 6\).
Data Range
For all data, \(1 \le n \le 2 \cdot 10^5\) and \(0 \le K \le 5000\).
Subtask 1 (5 pts): \(n = 1\).
Subtask 2 (10 pts): \(n = 2\).
Subtask 3 (25 pts): \(K = 0\).
Subtask 4 (25 pts): \(0 \le K \le 10\).
Subtask 5 (35 pts): No special restrictions.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分