Pagini recente » Cod sursa (job #1793216) | Cod sursa (job #1942832) | Cod sursa (job #2943729) | Cod sursa (job #2987285) | Cod sursa (job #1072987)
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
using namespace std;
ifstream fin("diamant.in");
ofstream fout("diamant.out");
const int Nmax = 21;
const int Dmax = 120100;
const int Xmax = 44100;
const int MOD = 10000;
int N, M, X, A[Dmax], B[Dmax];
#define A (A + Xmax)
#define B (B + Xmax)
void Add(int val)
{
for(int i = -Xmax; i <= Xmax; i++)
{
B[i] += A[i - val];
B[i] += A[i + val];
}
for(int i = -Xmax; i <= Xmax; i++)
A[i] = (A[i] + B[i]) % MOD, B[i] = 0;
}
int main()
{
fin>>N>>M>>X;
if(X < -Xmax || Xmax < X) {fout<<'0'; return 0;}
A[0] = 1;
for(int i = 1; i <= N; i++)
for(int j = 1; j <= M; j++)
Add(i * j);
fout<<A[X];
return 0;
}