QOJ.ac

QOJ

実行時間制限: 2.0 s メモリ制限: 512 MB 満点: 100 ハック可能 ✓

#14427. Domain Compression

統計

Gojo has a tree with $n$ vertices. He learned the technique of domain compression, which works as follows:

  • First, he chooses some vertex $v$ which was not previously deleted from the graph. Next, for each pair of vertices $u < w$ which are connected to $v$, he adds an undirected edge $(u, w)$ if it was not previously contained in the graph. After that, he erases $v$ from the graph with all the edges incident to it.

For each $k$ ($1 \le k \le n$), he is interested in the total number of edges in the remaining graphs for all $\frac{n!}{(n-k)!}$ ways to perform the operations. Since the answers can be very large, output them modulo $998\,244\,353$.

Input

The first line contains an integer $n$ ($2 \le n \le 10^5$) — the number of vertices in the tree.

Next, $n - 1$ lines contain pairs of integers $u_i, v_i$ ($1 \le u_i, v_i \le n$) — the description of the edges of the tree.

Output

Output $n$ integers — the total number of edges for each $k$ modulo $998\,244\,353$.

Examples

Input 1

5
1 2
2 3
3 5
3 4

Output 1

16 44 60 0 0

Input 2

8
1 2
2 3
2 4
4 5
4 7
7 8
6 7

Output 2

51 316 1596 6120 15720 20160 0 0

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#365EditorialOpen题解jianglyView

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.