Pagini recente » Cod sursa (job #3267398) | Cod sursa (job #1546620) | Cod sursa (job #2432158) | Cod sursa (job #717284) | Cod sursa (job #167693)
Cod sursa(job #167693)
var a,b:array [-50000..50000] of longint;
v:array [0..409] of longint;
n,i,j,k,m,p,u:longint;
f,g:text;
begin
assign(f,'diamant.in');reset(f);
assign(g,'diamant.out');rewrite(g);
read(f,n,m,k);
u:=0;
p:=0;
for i:=1 to n do
for j:=1 to m do begin
u:=u+1;
v[u]:=i*j;
p:=p+i*j;
end;
if (k>p) then writeln(g,'0')
else begin
a[0]:=1;
p:=0;
for i:=1 to n*m do begin
p:=p+v[i];
for j:=p+10 downto -p-10 do
b[j]:=(a[abs(j-v[i])]+a[j]+a[j+v[i]]) mod 10000;
a:=b;
end;
writeln(g,b[k]);
end;
close(f);
close(g);
end.