Pagini recente » Cod sursa (job #1467083) | Cod sursa (job #223482) | Cod sursa (job #2139817) | Cod sursa (job #2074161) | Cod sursa (job #35732)
Cod sursa(job #35732)
//oni 2006 diamant cls 11-12 ziua 1
const min = -44100;
max = 44100;
var n,m,x: longint;
a,b:array[min-400..max+400] of longint;
procedure calc;
var i,j,k:longint;
begin
a[0]:=1;
for i:=1 to n do
for j:=1 to m do
begin
for k:=min-400 to max+400 do
begin
b[k]:=(a[k+i*j] + a[k] + a[k-i*j]) mod 10000;
end;
a:=b;
end;
end;
begin
assign(input,'diamant.in'); reset(input);
assign(output,'diamant.out'); rewrite(output);
readln(n,m,x);
if abs(x) > 44100 then
writeln('0')
else
begin
calc;
writeln(a[x]);
end;
close(input); close(output);
end.