Codeforces Round 1012 (Div. 1)
E
Black Cat Collapse
Codeforces
3500
原题
← D→
翻译中…

The world of the black cat is collapsing.

翻译中…

In this world, which can be represented as a rooted tree with root at node $1$, Liki and Sasami need to uncover the truth about the world.

翻译中…

Each day, they can explore a node $u$ that has not yet collapsed. After this exploration, the black cat causes $u$ and all nodes in its subtree to collapse. Additionally, at the end of the $i$ th day, if it exists, the number $n-i+1$ node will also collapse.

翻译中…

For each $i$ from $1$ to $n$, determine the number of exploration schemes where Liki and Sasami explore exactly $i$ days (i.e., they perform exactly $i$ operations), with the last exploration being at node $1$. The result should be computed modulo $998\,244\,353$.

翻译中…

Note: It is guaranteed that nodes $1$ to $n$ can form a "DFS" order of the tree, meaning there exists a depth-first search traversal where the $i$ th visited node is $i$.

翻译中…

Input

翻译中…

The first line contains an integer $t$ ($1 \le t \le 10$) — the number of test cases. The description of the test cases follows.

翻译中…

The first line of each test case contains exactly one number $n$ ($3 \le n \le 80$).

翻译中…

Each of the following $n - 1$ lines contains two integers $u_i$ and $v_i$, representing two vertices connected by an edge ($1 \le u_i, v_i \le n$). It is guaranteed that the given edges form a tree. It is also guaranteed that the vertices can form a "DFS" traversal order.

翻译中…

It is guaranteed that the sum of $n$ for all test cases does not exceed $80$

翻译中…

Output

翻译中…

For each test case, print $n$ integers, where the $i$ th integer represents the number of exploration schemes for exactly $i$ days, modulo $998\,244\,353$.

翻译中…

Note

翻译中…

For the first test case, the following operation sequences are legal:

翻译中…

$\{1\},\{2,1\},\{3,1\},\{4,1\},\{3,2,1\},\{4,2,1\},\{4,3,1\},\{4,3,2,1\}$.

翻译中…

样例

Input #1
2
4
1 2
2 3
2 4
7
4 2
6 1
5 1
7 6
2 3
1 2
Output #1
1 3 3 1
1 6 23 48 43 17 1
InputCopy OutputCopy
题目信息
题号
2089E
时间限制
3 s
内存限制
1024 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。