Pagini recente » Cod sursa (job #445507) | Cod sursa (job #1043636) | Cod sursa (job #2370267) | Cod sursa (job #2802397) | Cod sursa (job #426023)
Cod sursa(job #426023)
var v,t:array[-45000..45000]of longint;
x:array[0..1000]of longint;
i,j,n,m,c,s:longint;
begin
assign(input,'diamant.in');reset(input);
assign(output,'diamant.out');rewrite(output);
readln(n,m,c);
for i:=1 to n do
for j:=1 to m do
begin
s:=s+i*j;
inc(x[0]);
x[x[0]]:=i*j;
end;
if (c>s)or(c<-s) then
begin
writeln(0);
close(output);
halt;
end;
v[0]:=1;
t[0]:=1;
for i:=1 to x[0] do
begin
for j:=-s to s do
if (t[j]<>0){((t[j]=0)or((v[j]>1)))} then
begin
if (x[i]+j<=s)and(x[i]+j>=-s) then
begin
inc(v[x[i]+j],t[j]);
v[x[i]+j]:=v[x[i]+j] mod 10000;
end;
if (-x[i]+j<=s)and(-x[i]+j>=-s) then
begin
inc(v[-x[i]+j],t[j]);
v[-x[i]+j]:=v[-x[i]+j] mod 10000;
end;
end;
t:=v;
end;
writeln(v[c] mod 10000);
close(input);close(output);
end.