Pagini recente » Istoria paginii runda/test12321321/clasament | Cod sursa (job #2424416) | Cod sursa (job #1752450) | Cod sursa (job #1804007) | Cod sursa (job #2185666)
#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;
}