DP…
/**************************************************************
Problem: 1037
User: zhuohan123
Language: C++
Result: Accepted
Time:448 ms
Memory:1792 kb
****************************************************************/ #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
inline int imax(int a,int b){return a>b?a:b;}
inline int imin(int a,int b){return a<b?a:b;}
const int mo=;
inline int add(int &a,int b){a=(a+b)%mo;}
int f[][][][];
//f[总人数][男生数][男-女][女-男] P.S.最后两维若是负数则当为0
int main(int argc, char *argv[])
{
int n,m,k;cin>>n>>m>>k;
f[][][][]=;
for(int i=;i<n+m;i++)
{
memset(f[(i+)&],,sizeof f[(i+)&]);
for(int j=;j<=imin(i,n);j++)
for(int bmg=;bmg<=imin(j,k);bmg++)
for(int gmb=;gmb<=imin(i-j,k);gmb++)
{
if(bmg<k&&j<n)add(f[(i+)&][j+][bmg+][imax(gmb-,)],f[i&][j][bmg][gmb]);
if(gmb<k&&(i-j)<m)add(f[(i+)&][j][imax(bmg-,)][gmb+],f[i&][j][bmg][gmb]);
}
}
int ans=;
for(int i=;i<=k;i++)
for(int j=;j<=k;j++)
add(ans,f[(n+m)&][n][i][j]);
cout<<ans<<endl;
return ;
}