There is a tree,there is a life.Can you solve this problem about tree?
Here we have a tree which has n vertices.
We define dist(u, v) as the number of edges on the path from u to v.
And for each vertices u , define Eu
Give you the tree and k.
for every vertices(from 1 to n).(mod 10007 for convenience).