Problem D. Daylight
时间限制 13000 ms
内存限制 256 MB
Noah owns an unrooted tree with $n$ vertices which are numbered from $1$ to $n$. Every morning Noah would like to pick two vertices $u$ and $v$ to get influence from daylight and then the influence spreads through edges, but the influence will be disappeared if it has passed through more than $w$ edges.
Your task is to calculate the number of vertices influenced by the daylight for each day. In addition, input data will be encrypted to make sure your solution is online.
输入数据
输出数据
For each day, print the answer in one line.
It is guaranteed that the size of the standard output file does not exceed $7$ MiB.
样例输入
复制
1
5 5
1 2
2 3
2 4
3 5
5 1 0
3 4 4
1 2 3
5 1 3
5 1 4
样例输出
样例说明
The decrypted information is the following: Day 1: u = 1, v = 2, w = 0; Day 2: u = 1, v = 2, w = 1; Day 3: u = 1, v = 2, w = 2; Day 4: u = 1, v = 2, w = 3; Day 5: u = 1, v = 2, w = 4.
$ Mathjax font initiator $