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++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include<bits/stdc++.h>
using namespace std;
namespace mine
{
    typedef long long ll;
    #define pr pair<int,int>
    #define FR first
    #define SE second
    #define MP make_pair
    #define PB push_back
    #define vc vector
    #define all(x) (x).begin(),(x).end()
    #define sz(x) ((int)(x).size())
    #define bin(x) (1ll<<(x))
    #define GG(x) if(x) puts("error")
    ll qread()
    {
        ll ans=0,f=1;char c=getchar();
        while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
        while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
        return ans*f;
    }
    void write(ll num)
    {
        if(num<0) putchar('-'),num=-num;
        if(num>=10) write(num/10);
        putchar('0'+num%10);
    }
    void write1(ll num){write(num);putchar(' ');}
    void write2(ll num){write(num);putchar('\n');}
    template<typename T> void chmax(T &x,const T y) {x=(x>y?x:y);}
    template<typename T> void chmin(T &x,const T y) {x=(x<y?x:y);}
    ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

    const int INF=0x3f3f3f3f;
    const int MOD=924844033;
    inline int mm(const int x){return x>=MOD?x-MOD:x;}
    template<typename T> inline void add(T &x,const T y){x=mm(x+y);}
    inline ll qpower(ll x,ll e)
    {
        ll ans=1;GG(e<0);
        while(e){if(e&1)ans=ans*x%MOD;x=x*x%MOD;e>>=1;}return ans;
    }
    ll invm(ll x){return qpower(x,MOD-2);}
    const int N=2e5+10;

    namespace PP//全家桶板子
    {
        const int LN=1<<19;int inv[LN];
        struct NTT
        {
            vc<int> w[30];NTT(){inv[1]=1;for(int i=2;i<LN;i++) inv[i]=ll(MOD-MOD/i)*inv[MOD%i]%MOD;
                for(int i=1;i<=19;i++) {w[i].PB(1);int pp=qpower(5,(MOD-1)/bin(i));for(int j=1;j<bin(i-1);j++) w[i].PB(1ll*w[i][j-1]*pp%MOD);}
            }
            int R[LN];inline void DFT(int A[],int lg,int op=0)
            {
                int m=bin(lg);GG(m>=LN);if(op) reverse(A+1,A+m);
                for(int i=1;i<m;i++){R[i]=(R[i>>1]>>1)|((i&1)<<(lg-1));if(R[i]<i)swap(A[i],A[R[i]]);}
                for(int ln=1,lgg=1;ln<m;ln<<=1,lgg++) for(int st=0;st<m;st+=2*ln) for(int k=0;k<ln;k++)
                    {int t=1ll*w[lgg][k]*A[st+ln+k]%MOD;A[st+ln+k]=mm(A[st+k]+MOD-t);A[st+k]=mm(A[st+k]+t);}
            }
        }ntt;
        int _A[LN],_B[LN],_C[LN],M;
        struct P//此结构体内函数选择性写
        {
            vc<int> a;int n;void rs(int nn){a.resize(n=nn);}P(){rs(M);}
            int& operator [] (int x){return a[x];}
            friend const P operator * (P a,const int &b) {for(int i=0;i<a.n;i++) a[i]=(ll)a[i]*b%MOD;return a;}
            inline void dft(int _A[],int lg,int ln){for(int i=0;i<bin(lg);i++)_A[i]=(i<min(ln,n)?a[i]:0);ntt.DFT(_A,lg);}
            inline void idft(int _A[],int lg,int ln){ntt.DFT(_A,lg,1);rs(ln);for(int i=0;i<ln;i++)a[i]=1ll*_A[i]*inv[bin(lg)]%MOD;}
            const P Mul(P b,int ln)
            {
                int lg=ceil(log2(ln+ln-1)),m=bin(lg);dft(_A,lg,ln);b.dft(_B,lg,ln);
                for(int i=0;i<m;i++) _B[i]=1ll*_A[i]*_B[i]%MOD;b.idft(_B,lg,ln);return b;
            }
            const P operator * (const P b) {return Mul(b,M);}
        };
        void Inv(P &a,P &b,int ln)
        {
            if(ln==1){b.rs(1);b[0]=invm(a[0]);return;}Inv(a,b,(ln+1)/2);
            int lg=ceil(log2(ln+ln-1)),m=bin(lg);a.dft(_A,lg,ln);b.dft(_B,lg,ln);
            for(int i=0;i<m;i++) _B[i]=(2+MOD-1ll*_B[i]*_A[i]%MOD)*_B[i]%MOD;b.idft(_B,lg,ln);
        }
        P Ji(P a){a.rs(a.n+1);for(int i=a.n-1;i>=1;i--)a[i]=1ll*a[i-1]*inv[i]%MOD;a[0]=0;return a;}
        P Dao(P a){for(int i=0;i<a.n-1;i++)a[i]=1ll*a[i+1]*(i+1)%MOD;a.rs(a.n-1);return a;}
        P Ln(P &a,int ln){P b;Inv(a,b,ln);return Ji(Dao(a).Mul(b,ln-1));}
        void Exp(P &a,P &b,int ln)
        {
            if(ln==1){b.rs(1);b[0]=1;return;}Exp(a,b,(ln+1)/2);
            P pp=Ln(b,ln);for(int i=0;i<ln;i++) pp[i]=mm(a[i]+MOD-pp[i]);pp[0]++;
            int lg=ceil(log2(ln+ln-1)),m=bin(lg);pp.dft(_A,lg,ln);b.dft(_B,lg,ln);
            for(int i=0;i<m;i++) _B[i]=1ll*_A[i]*_B[i]%MOD;b.idft(_B,lg,ln);
        }
        void Sqrt(P &a,P &b,int ln)
        {
            if(ln==1){b.rs(1);b[0]=1;return;}Sqrt(a,b,(ln+1)/2);P tmp=b*2,c;Inv(tmp,c,ln);
            int lg=ceil(log2(ln+ln-1)),m=bin(lg);a.dft(_A,lg,ln);b.dft(_B,lg,ln);c.dft(_C,lg,ln);
            for(int i=0;i<m;i++) _A[i]=ll((ll)_B[i]*_B[i]+_A[i])%MOD*_C[i]%MOD;b.idft(_A,lg,ln);
        }
        P Rev(P a){reverse(a.a.begin(),a.a.end());return a;}
        P Inv(P a,int ln){P b;Inv(a,b,ln);return b;}
        P Div(const P &a,const P &b){return Rev(Rev(a).Mul( Inv(Rev(b),a.n-b.n+1),a.n-b.n+1 ) );}
    };

    vc<int> to[N];int siz[N];
    void dfs(int x,int fa)
    {
        siz[x]=1;for(int t=0;t<sz(to[x]);t++){int y=to[x][t];if(y==fa)continue;dfs(y,x);siz[x]+=siz[y];}
    }
    ll fac[N],num[N],ans[N];ll C(int n,int m){return fac[n]*invm(fac[m])%MOD*invm(fac[n-m])%MOD;}
    void main()
    {
        fac[0]=1;for(int i=1;i<N;i++) fac[i]=fac[i-1]*i%MOD;
        int n=qread();for(int i=1;i<n;i++){int x=qread(),y=qread();to[x].PB(y);to[y].PB(x);}dfs(1,0);
        using namespace PP;
        M=n+1;P A;for(int i=0;i<M;i++) A[i]=invm(fac[i]);

        memset(num,0,sizeof num);for(int i=2;i<=n;i++) num[siz[i]]++,num[n-siz[i]]++;
        P B;for(int i=0;i<=n;i++) B[n-i]=fac[i]*num[i]%MOD;
        B=A*B;for(int i=0;i<=n;i++) ans[i]=mm(C(n,i)*n%MOD+MOD-B[n-i]*invm(fac[i])%MOD);

        for(int i=1;i<=n;i++) write2(ans[i]);
    }//(ans+MOD)%MOD
};
int main()
{
    srand(time(0));
    mine::main();
}