The Kingdom of Tree has $N$ cities numbered from 1 to $N$. The $N$ cities are connected by $N-1$ roads, and any two cities are reachable via a sequence of roads. Obviously, the road system of the Kingdom of Tree is constructed according to a tree structure. That’s how the kingdom’s name comes.
To monitor and protect the roads, the general of the kingdom decides to build radar stations in the cities. We denote the radius of the radar station located in city $i$ as $R_i$. $R_i$ is a non-negative integer, and $R_i=0$ indicates that there is no radar station in city $i$. Given a road connecting city $i$ and city $j$, whose length is denoted as $L_{i,j}$, we say that the road is monitored by radar if $R_i+R_j≥L_{i,j}$.
The cost of building a radar station in city $i$ is proportional to its radius $R_i$. Given a construction plan of the radar stations $P=\{R_1,R_2,...,R_N \}$, we denote the set of monitored roads as S. The cost per length is thus defined as the ratio between the sum of $R_i$ and the sum of the length of monitored roads: $\sum_{i=1}^{N} R_{i}/\sum_{(i,j)∈S}L_{i,j}$.
Due to limited budget, the general wants to make the most of the money. He wants a construction plan that minimizes the cost per length. Note that he don’t have to monitor all the roads. As the most brilliant programmer of the Kingdom of Tree, can you help him to find such a construction plan?