Pagini recente » Cod sursa (job #1221850) | Cod sursa (job #1863857) | Cod sursa (job #931215) | Cod sursa (job #2658826) | Cod sursa (job #162822)
Cod sursa(job #162822)
#include <stdio.h>
#include <string.h>
#define MOD 10000
#define off 50000
int N, M, K;
int ant[100010];
int cur[100010];
int main()
{
int i, j, q, w, k;
freopen("diamant.in", "r", stdin);
freopen("diamant.out", "w", stdout);
scanf("%d %d %d", &N, &M, &K);
if (K > off || -K > off) { printf("0\n"); return 0; }
ant[off] = 1;
q = 0;
for (i = 1; i <= N; i++)
for (j = 1; j <= M; j++) {
q += i * j; w = i * j;
for (k = off - q; k <= off + q; k++)
cur[k] = (ant[k - w] + ant[k + w] + ant[k]) % 10000;
memcpy(ant, cur, sizeof(ant));
}
printf("%d\n", cur[off + K]);
return 0;
}