Pagini recente » Cod sursa (job #2834285) | Cod sursa (job #2947841) | Cod sursa (job #2335976) | Cod sursa (job #770223) | Cod sursa (job #42706)
Cod sursa(job #42706)
const cs = 44100;
var fi,fo:text;
ii,i,j,n,m,ind,k,aux:longint;
x:qword;
a:array[0..89000] of longword;
c:array[0..89000] of longword;
begin
assign(fi,'diamant.in'); reset(fi);
assign(fo,'diamant.out'); rewrite(fo);
readln(fi,m,n,x);
a[cs]:=1;
for i:=1 to m do
for j:=1 to n do
begin
for k:=0 to 2*cs do
begin
c[k]:=a[k];
if k-i*j>=0 then
c[k]:=c[k]+a[k-i*j];
if k+j*i<=2*cs then
c[k]:=c[k]+a[k+i*j];
c[k]:=c[k] mod 10000;
end;
ind:=sizeof(c);
ii:=1;
while c[ii]< ind do
begin
aux:=a[ii];
a[ii]:=c[ii];
c[ii]:=aux;
inc(ii);
end;
end;
writeln(fo,a[cs+x]);
close(fo);
end.