Pagini recente » Cod sursa (job #1411999) | Cod sursa (job #3214209) | Cod sursa (job #550383) | Cod sursa (job #2691455) | Cod sursa (job #300480)
Cod sursa(job #300480)
#include<fstream.h>
#define xx 21
#define max 44100
ifstream fin("diamant.in");
ofstream fout("diamant.out");
int a[max+802],b[max+802],n,m,k,i,j,t;
int main()
{
fin>>n>>m>>k;
if(k>max)
fout<<"0\n";
else
{
a[400]=1;
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
{
memcpy(b,a,sizeof(b));
for(t=max+802;t>=0;t--)
{
a[t]=b[t+i*j]+b[t]+b[t-i*j];
a[t]%=10000;
}
}
if(k<0) k*=-1;
fout<<a[k+400]<<'\n';
}
fout.close();
return 0;
}