Pagini recente » Cod sursa (job #2605237) | Cod sursa (job #2715383) | Cod sursa (job #3291459) | Cod sursa (job #2706262) | Cod sursa (job #70266)
Cod sursa(job #70266)
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]);
//t[x[i]+j]:=1;
end;
if (-x[i]+j<=s)and(-x[i]+j>=-s) then
begin
inc(v[-x[i]+j],t[j]);
//t[-x[i]+j]:=1;
end;
end;
t:=v;
end;
writeln(v[c]);
close(input);close(output);
end.