409934: GYM103860 D Tree Partition

Memory Limit:1024 MB Time Limit:3 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

D. Tree Partitiontime limit per test3 secondsmemory limit per test1024 megabytesinputstandard inputoutputstandard output

You are given a tree of $$$n$$$ vertices, indexed in $$$1$$$ to $$$n$$$. Note that by deleting $$$x-1$$$ edges, the tree will become $$$x$$$ connected components.

It is required that after deleting edges, for each component, the set of indexes value in it is a continuous interval. That is, denoting the minimum and maximum value of the index value of the component as $$$l$$$ and $$$r$$$, every vertice indexed in $$$[l,r]$$$ should belong to the same component.

Now for $$$x=1,2,\dots,k$$$, you need to compute the number of ways to delete edges. Two ways are different if at least one edge is deleted in one of them and preserved in the other. You only need to compute the answer modulo $$$998244353$$$.

Input

The first line has two integers $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$) and $$$k$$$ ($$$1 \leq k \leq \min(n, 400)$$$).

In the following $$$n-1$$$ lines, there are two integers $$$x,y$$$ ($$$1 \leq x, y \leq n, x \ne y$$$) in each line, indicating an edge $$$(x,y)$$$.

Output

Output $$$k$$$ lines, each line with an integer, indicating the answer modulo $$$998244353$$$.

ExamplesInput
4 3
1 2
2 3
2 4
Output
1
2
2
Input
7 7
2 5
3 6
4 5
5 1
1 6
6 7
Output
1
1
0
0
1
2
1

加入题单

上一题 下一题 算法标签: