AT_arc215_f [ARC215F] Scapus
Description
You are given a tree with $ N $ vertices numbered $ 1 $ to $ N $ . The $ i $ -th edge ( $ 1 \le i \le N - 1 $ ) connects vertices $ A_i $ and $ B_i $ . For a path in this tree, define the score of the path as the distance from the path to the farthest vertex. Here, the distance from a path is defined as the minimum distance to a vertex on the path.
A path with the minimum score is called a good path.
For each $ k = 1, 2, \ldots, N $ , find the number of good paths with exactly $ k $ vertices. Paths are distinguished only if their vertex sets differ.
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ A_1 $ $ B_1 $ $ A_2 $ $ B_2 $ $ \vdots $ $ A_{N - 1} $ $ B_{N - 1} $
Output Format
Output $ N $ lines.
The $ k $ -th line should contain the number of good paths with exactly $ k $ vertices.
Explanation/Hint
### Sample Explanation 1
The minimum score is $ 1 $ .
The good paths are the following six paths.
- The path with two vertices connecting vertices $ 2 $ and $ 3 $
- The path with three vertices connecting vertices $ 1 $ and $ 3 $
- The path with three vertices connecting vertices $ 2 $ and $ 5 $
- The path with three vertices connecting vertices $ 3 $ and $ 4 $
- The path with four vertices connecting vertices $ 1 $ and $ 5 $
- The path with four vertices connecting vertices $ 4 $ and $ 5 $
### Constraints
- $ 2 \le N \le 2 \times 10^5 $
- $ 1 \le A_i < B_i \le N $ ( $ 1 \le i \le N - 1 $ )
- The given graph is a tree.
- All input values are integers.