#P17149. [ICPC 2017 Xi'an R] Island

    ID: 19427 远端评测题 10000ms 512MiB 尝试: 0 已通过: 0 显示难度省选/NOI− 上传者: 标签>2017树链剖分生成函数ICPC西安

[ICPC 2017 Xi'an R] Island

Problem Description

As a member of The Academy of Chtholly, you want to rush to the battle field to help Chtholly.

There are nn islands in the sky, and you are in island number 11.

At first, there are n1n-1 transportation lines, each connecting two islands, making each two islands reachable.

However, due to the continues attack of the beasts on the ground, each transportation line has 50%50\% possibility of being destroyed.

You want to find, in all 2n12^{n-1} possible realities (each transportation line may be destroyed or not), how many of them you can reach exactly kk islands. The answer may be large, so you just need to output the answer mod 18119393291811939329.

Input Format

The input contains multiple test cases.

The first line contains a number TT (1T201 \le T \le 20) denoting the number of test cases.

In each test case:

The first line contains a number nn (1n1051 \le n \le 10^5).

The following n1n-1 lines each contains two numbers xx, yy denoting that there is an edge between xx and yy.

Output Format

For each test case, output one line containing nn numbers.

The kk-th number is the number of possible realities that you can reach exactly kk islands.

1
5
1 2
2 3
3 4
4 5
8 4 2 1 1