Pagini recente » Cod sursa (job #396908) | Cod sursa (job #1284516) | Cod sursa (job #2767576) | Cod sursa (job #382111) | Cod sursa (job #35348)
Cod sursa(job #35348)
//oni 2006 diamant cls 11-12 ziua 1
const min = -44100;
max = 44100;
var n,m,x: longint;
a,b:array[min..max] 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 to max 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.