Pagini recente » Cod sursa (job #2077245) | Cod sursa (job #2061848) | Cod sursa (job #2187372) | Cod sursa (job #638552) | Cod sursa (job #1341545)
#include <cstdio>
#define nmax 900900
using namespace std;
int a[nmax], b[nmax];
int n, m, x, i, j;
inline void add(short value)
{
for(int i=value; i<=90000; ++i)
b[i]+=a[i-value];
for(int i=0; i<=90000; ++i)
b[i]+=a[i+value];
for(int i=0; i<=90000; ++i)
a[i]=(a[i]+b[i])%10000, b[i]=0;
}
int main()
{
freopen("diamant.in", "rt", stdin);
freopen("diamant.out", "wt", stdout);
scanf("%d%d%d", &n, &m, &x);
if(x>44100 || x<-44100)
{
printf("0\n");
return 0;
}
a[45000]=1;
for(i=1; i<=m; ++i)
for(j=1; j<=n; ++j)
add(i*j);
printf("%hd", a[x+45000]);
return 0;
}