#include using namespace std; using ll = long long; #define fi first #define se second constexpr ll mod=998244353; const int MAX = 505000; ll fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit(){ fac[0]=fac[1]=1; finv[0]=finv[1]=1; inv[1]=1; for(int i=2;i> dp(x+1,vector(2*k+1,0)); //dp[i][j] := move2 i times & distance j-k dp[0][k]=1; for(int i=0;i<=x;i++){ for(int j=2*k;j>=0;j--){ if(j-2>=0){ dp[i][j-2]+=dp[i][j]; if(dp[i][j-2]>mod){ dp[i][j-2]-=mod; } } } if(i!=x){ for(int j=0;j<=k;j++){ int r=k-j,s=k+j; if(r+2<=2*k){ dp[i+1][r+2]+=dp[i][r]; if(dp[i+1][r+2]>mod){ dp[i+1][r+2]-=mod; } } if(r!=s){ r=s; if(r+2<=2*k){ dp[i+1][r+2]+=dp[i][r]; if(dp[i+1][r+2]>mod){ dp[i+1][r+2]-=mod; } } } } } } ll ans=0; for(int i=0;i<=x;i++){ ll way=dp[i][k]; way*=(COM(h+w,h-i)*COM(w+i,w-i))%mod; way%=mod; ans+=way; ans%=mod; } cout<=0){ if(a%2==1){ way-=2*COM(2*i,i-a*kk); if(way>mod){ way%=mod; } } else{ way+=2*COM(2*i,i-a*kk); if(way>mod){ way%=mod; } } a++; } if(way<0){ way+=mod*100; way%=mod; } way*=(COM(h+w,h-i)*COM(w+i,w-i))%mod; way%=mod; ans+=way; ans%=mod; } cout<>h>>w>>k; h--; w--; if(k<=75){ solve1(h,w,k); } else{ solve2(h,w,k); } }