#include #include #include using namespace std; #include template struct combination{ vectorfac,ifac; combination(size_t N=0):fac(1,1),ifac(1,1) { make_table(N); } void make_table(size_t N) { if(fac.size()>N)return; size_t now=fac.size(); N=max(N,now*2); fac.resize(N+1); ifac.resize(N+1); for(size_t i=now;i<=N;i++)fac[i]=fac[i-1]*i; ifac[N]=1/fac[N]; for(size_t i=N;i-->now;)ifac[i]=ifac[i+1]*(i+1); } T factorial(size_t n) { make_table(n); return fac[n]; } T invfac(size_t n) { make_table(n); return ifac[n]; } T P(size_t n,size_t k) { if(nC; int N,M,K; int main() { cin>>N>>M>>K; int T=min(N,M); vectordp(T+1); for(int c=0;c<=T;c++) { const mint coef=C.C(N,c)*C.C(M,c); //x^c * (1-x)^(T-c) for(int i=0;i<=T-c;i++) { if(i%2==0)dp[i+c]-=C.C(T-c,i)*coef; else dp[i+c]+=C.C(T-c,i)*coef; } } vectorE(N*M-T+1); { int K=N*M-T; for(int i=0;i<=K;i++) { E[i]=C.C(K,i); if(i%2==1)E[i]=-E[i]; } } dp=atcoder::convolution(dp,E); for(int i=0;i+1