#P7728. 旧神归来(Return of Them)

旧神归来(Return of Them)

Background

With the decisive battle between the phantom and the shadow, the completion of the Moon Island altar, the appearance of the celestial storm, and the arrival of the heavenly guardians, all secrets of the Moon and ancient times seem to have reached the final chapter.

The old gods are about to return.

Problem Description

An ordinary tree on Moon Island keeps growing under the erosion of moonlight, and becomes even more uncontrolled as the lunar storm arrives.

Specifically, the growth rules are as follows:

  • Initially, there is a rooted tree T0T_0 with nn nodes, rooted at 11.

  • On day ii, the tree grows from Ti1T_{i - 1} into TiT_i. The rule is: let vv be a leaf node in Ti1T_{i - 1} with the minimum depth (if there are multiple, choose any one). Replace the node vv with Ti1T_{i - 1} itself.

In this problem, the depth of a node is defined as the number of edges on the simple path from it to the root node. Note that this may differ from the usual definition.

The figure below shows an example of growing from Ti1T_{i-1} to TiT_i:

Besides dealing with the heavenly guardians, it is also important to estimate environmental effects, so you need to compute:

  • For each integer d[1,m]d \in [1, m], find SdS_d, the minimum number of days such that, in TSdT_{S_d}, the minimum depth among all leaf nodes is greater than dd.

Output the answers modulo 998244353998244353.

Input Format

The first line contains two integers n,mn, m, representing the number of nodes in T0T_0 and the depth range for which answers are required.

In the next n1n - 1 lines, each line contains two integers x,yx, y, indicating that there is an edge between nodes xx and yy in T0T_0.

Output Format

Output mm lines. On the ii-th line, output one integer representing SiS_i.

4 10
1 2
2 3
1 4

1
3
4
7
9
12
16
24
32
45

Hint

[Sample 1 Explanation]

The figure shows the shapes of T0T_0 to T3T_3. The shallowest leaf is marked in red, and the part grown in the most recent operation is marked in blue.

You can see that, in T1T_1, the minimum leaf depth is greater than 11; in T3T_3, the minimum leaf depth is greater than 22; and after one more operation, in T4T_4, the minimum leaf depth will be greater than 33 (it should be 44). This explains the first three lines of the sample output:


[Constraints]

This problem uses bundled testdata.

For 100%100\% of the testdata: 2n,m1052 \le n, m \le {10}^5.

Subtask ID Score n,mn, m \le Special Constraint
11 1212 1010 T0T_0 is a binary tree
22 88 105{10}^5 T0T_0 is a chain with 11 as an endpoint
33 2525 T0T_0 is a binary tree, and every non-leaf node has two children
44 1010 100100 None
55 1212 10001000
66 1515 3000030000
77 1818 105{10}^5

Translated by ChatGPT 5