Problem:
Score : 1900 points

Problem Statement

#nck {
width: 30px;
height: auto;
}

One day, Takahashi was given the following problem from Aoki:

You are given a tree with N vertices and an integer K. The vertices are numbered 1 through N. The edges are represented by pairs of integers (a_i, b_i).

For a set S of vertices in the tree, let f(S) be the minimum number of the vertices in a subtree of the given tree that contains all vertices in S.

There are ways to choose K vertices from the trees. For each of them, let S be the set of the chosen vertices, and find the sum of f(S) over all ways.

Since the answer may be extremely large, print it modulo 924844033(prime).

Since it was too easy for him, he decided to solve this problem for all K = 1,2,...,N.

Constraints

2 ≦ N ≦ 200,000

1 ≦ a_i, b_i ≦ N

The given graph is a tree.

Input

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}

Output

Print N lines. The i-th line should contain the answer to the problem where K=i, modulo 924844033.

Sample Input 1

3
1 2
2 3

Sample Output 1

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.

Sample Input 2

4
1 2
1 3
1 4

Sample Output 2

4
15
13
4

Sample Input 3

7
1 2
2 3
2 4
4 5
4 6
6 7

Sample Output 3

7
67
150
179
122
45
7

Solution in C++ (Clang 10.0.0) (judge verdict: Wrong Answer)

#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>

#define N 600050
#define LL long long
const int mod=924844033,G1=5,G2=(3ll*mod+1)/G1;
using namespace std;
int n;
int he[N],ne[N<<2],to[N<<2],tot;
inline void addedge(int x,int y){
	to[++tot]=y;ne[tot]=he[x];he[x]=tot;
}
inline int qpow(int d,int z){
	int ret=1;
	for(;z;z>>=1,d=1ll*d*d%mod)
		if(z&1)ret=1ll*ret*d%mod;
	return ret;
}
int inc[N],inv[N];
inline int C(int n,int m){
	return 1ll*inc[n]*inv[m]*inv[n-m]%mod;
}
inline void init(int n){
	inc[0]=inv[0]=1;
	for(int i=1;i<=n;++i)inc[i]=1ll*inc[i-1]*i%mod;
	inv[n]=qpow(inc[n],mod-2);
	for(int i=n-1;i;--i)inv[i]=1ll*inv[i+1]*(i+1)%mod;
}
int sz[N],a[N],b[N];
inline void dfs(int g,int fa){
	sz[g]=1;
	for(int i=he[g];i;i=ne[i])
		if(to[i]!=fa)dfs(to[i],g),sz[g]+=sz[to[i]];
	if(fa)(a[sz[g]]+=inc[sz[g]])%=mod,(a[n-sz[g]]+=inc[n-sz[g]])%=mod;
}
inline void ntt(int *a,int n,int tag){
	static int r[N],cnt;cnt=-2;
	for(int i=n;i;i>>=1,++cnt);
	for(int i=0;i<n;++i){
		r[i]=(r[i>>1]>>1)|((i&1)<<cnt);
		if(r[i]>i)swap(a[i],a[r[i]]);
	}
	for(int i=1;i<n;i<<=1){
		int u=qpow(tag==1?G1:G2,mod/i/2),w=1;
		for(int j=0,I=i<<1;j<n;j+=I,w=1){
			for(int k=0;k<i;++k,w=1ll*w*u%mod){
				int t=1ll*w*a[j+k+i]%mod;
				a[j+k+i]=(a[j+k]+mod-t)%mod;
				a[j+k]=(a[j+k]+t)%mod;
			}
		}
	}
	if(tag==1)return;
	const LL iv=qpow(n,mod-2);
	for(int i=0;i<n;++i)a[i]=iv*a[i]%mod;
}

int main(){
	cin>>n;init(n+n);
	for(int i=1,x,y;i<n;++i)
		scanf("%d%d",&x,&y),addedge(x,y),addedge(y,x);
	dfs(1,0);
	for(int i=0;i<=n;++i)b[n-i]=inv[i];
	int len=1;while(len<=n)len<<=1;len<<=1;
	ntt(a,len,1);ntt(b,len,1);
	for(int i=0;i<len;++i)a[i]=1ll*a[i]*b[i]%mod;
	ntt(a,len,-1);
	for(int i=1;i<=n;++i)a[i]=a[i+n];
	for(int i=1;i<=n;++i){
		a[i]=1ll*inv[i]*(1ll*inc[n]*inv[n-i]*n+mod-a[i])%mod;
		printf("%d\n",(a[i])%mod);
	}
	return 0;
}