Problem: You are given a tree (a connected graph without cycles) with vertices.
Consider a fixed integer . Then, the graph is an undirected graph with vertices, where an edge between vertices and exists if and only if the distance between vertices and in the given tree is at least .
For each from to , print the number of connected components in the graph .
Input Format: The first line contains the integer () — the number of vertices in the graph.
Each of the next lines contains two integers and (), denoting an edge between vertices and in the tree. It is guaranteed that these edges form a valid tree.
Output Format: Output integers: the number of connected components in the graph for each from to .
Note: In the first example: If , the graph has an edge between each pair of vertices, so it has one component. If , the graph has only edges and , so the graph has components.
In the second example: when or the graph has one component. When the graph splits into components: one component has vertices , and , and two more components contain one vertex each. When or each vertex is a separate component.