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