Pagini recente » Cod sursa (job #1530347) | Cod sursa (job #2803542) | Cod sursa (job #2998957) | Cod sursa (job #112293) | Cod sursa (job #1094011)
#include<cstdio>
using namespace std;
#define MOD 10000
int n,m,t,x,a[100000],b[100000],*p=a+50000,*q=b+50000;
int main()
{
int i,j,k;
freopen("diamant.in","r",stdin);
freopen("diamant.out","w",stdout);
scanf("%d%d%d",&n,&m,&x);
p[-1]=p[0]=p[1]=1, t=1;
for (i=1;i<=n;++i)
for (j=1;j<=m;++j)
if (i!=1 || j!=1)
{
t+=i*j;
for (k=-t;k<=t;++k)
q[k]=(p[k-i*j]+p[k]+p[k+i*j])%MOD;
for (k=-t;k<=t;++k)
p[k]=q[k];
}
printf("%d\n",p[x]);
return 0;
}