Pagini recente » Cod sursa (job #312049) | Cod sursa (job #713592) | Cod sursa (job #224069) | Cod sursa (job #1644340) | Cod sursa (job #2185664)
#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>2870 || x<-2870){
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;
}
400 + 361 + 324 + 289 + 256 + 225 + 196 + 169