Pagini recente » Cod sursa (job #2355525) | Cod sursa (job #2251104) | Cod sursa (job #1548343) | Cod sursa (job #1467520) | Cod sursa (job #2185671)
#include<bits/stdc++.h>
using namespace std;
ifstream in("diamant.in");
ofstream out("diamant.out");
int nw[100000],old[100000];
using namespace std;
int main()
{
long long x;
int n,m,i,j,k;
//freopen("input.txt","r",stdin);
in>>n>>m>>x;
if(x>44100 || x<-44100){
cout<<0;
return 0;
}
old[4999]=old[5000]=old[5001]=1;
for(i=1;i<=n;i++)
for(j=1;j<=m;j++)
if( !( (i==1)&&(j==1) ) ){
for(k=500;k<9500;k++)
nw[k]=((old[k]+old[k-i*j])%10000+old[k+i*j])%10000;
/*
for(k=5000-10;k<5000+10;k++)
cout<<nw[k]<<" ";
cout<<endl;
*/
for(k=500;k<9500;k++)
old[k]=nw[k];
}
out<<old[x+5000];
return 0;
}