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

    ID: 16755 Type: RemoteJudge 10000ms 512MiB Tried: 0 Accepted: 0 Difficulty: 9 Uploaded By: Tags>2017树链剖分生成函数ICPC西安

[ICPC 2017 Xi'an R] Island

题目描述

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 n−1n-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 2n−12^{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.

输入格式

The input contains multiple test cases.

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

In each test case:

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

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

输出格式

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