Score : 1900 points
One day, Takahashi was given the following problem from Aoki:
Since it was too easy for him, he decided to solve this problem for all K = 1,2,...,N.
The input is given from Standard Input in the following format:
N a_1 b_1 a_2 b_2 : a_{N-1} b_{N-1}
Print N lines. The i-th line should contain the answer to the problem where K=i, modulo 924844033.
3 1 2 2 3
3 7 3
The diagram above illustrates the case where K=2. The chosen vertices are colored pink, and the subtrees with the minimum number of vertices are enclosed by red lines.
4 1 2 1 3 1 4
4 15 13 4
7 1 2 2 3 2 4 4 5 4 6 6 7
7 67 150 179 122 45 7