#include using namespace std; using ll = long long; #define fi first #define se second constexpr ll mod=998244353; const int MAX = 405000; 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(k+1,0)); //dp[i][j] := move2 i times & distance j-k dp[0][k/2]=1; for(int i=0;i<=x;i++){ for(int j=k;j>=0;j--){ if(j-1>=0){ dp[i][j-1]+=dp[i][j]; if(dp[i][j-1]>mod){ dp[i][j-1]-=mod; } } } if(i!=x){ for(int j=0;j<=k;j++){ int r=k-j,s=k+j; if(r+1<=k){ dp[i+1][r+1]+=dp[i][r]; if(dp[i+1][r+1]>mod){ dp[i+1][r+1]-=mod; } } if(r!=s){ r=s; if(r+1<=k){ dp[i+1][r+1]+=dp[i][r]; if(dp[i+1][r+1]>mod){ dp[i+1][r+1]-=mod; } } } } } } ll ans=0; for(int i=0;i<=x;i++){ ll way=dp[i][k/2]; 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); way%=mod; } else{ way+=2*COM(2*i,i-a*kk); 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<=300){ solve1(h,w,k); } else{ solve2(h,w,k); } }