#485
Unrated

Circus

시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

The NN cows of Farmer John's Circus (1≤N≤1051 \leq N \leq 10^5) are preparing their upcoming acts. The acts all take place on a tree with vertices labeled 1…N1\ldots N. The "starting state" of an act is defined by a number 1≤K≤N1 \leq K \leq N and an assignment of cows 1…K1\dots K to the vertices of the tree, so that no two cows are located at the same vertex.

In an act, the cows make an arbitrarily large number of "moves." In a move, a single cow moves from her current vertex to an unoccupied adjacent vertex. Two starting states are said to be equivalent if one may be reached from the other by some sequence of moves.

For each 1≤K≤N1 \leq K \leq N, help the cows determine the number of equivalence classes of starting states: that is, the maximum number of starting states they can pick such that no two are equivalent. Since these numbers may be very large, output their remainders modulo 109+710^9 + 7.

입력

Line 11 contains NN.

Lines 2≤i≤N2\le i\le N each contain two integers aia_i and bib_i denoting an edge between aia_i and bib_i in the tree.

출력

For each 1≤i≤N,1\le i\le N, the ii-th line of output should contain the answer for K=iK=i modulo 109+710^9+7.

예제 입력 1

5
1 2
2 3
3 4
3 5

예제 출력 1

1
1
3
24
120

예제 입력 2

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

예제 출력 2

1
1
1
6
30
180
5040
40320

점수

Test cases 3-4 satisfy N≤8.N\le 8.Test cases 5-7 satisfy N≤16.N\le 16.Test cases 8-10 satisfy N≤100N\le 100 and the tree forms a "star;" at most one vertex has degree greater than two.Test cases 11-15 satisfy N≤100N\le 100.Test cases 16-20 satisfy no additional constraints.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출

제출 내역이 없습니다.

맞은 사람

아직 맞은 사람이 없습니다.

난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출

제출 내역이 없습니다.