Pagini recente » Cod sursa (job #1308089) | Cod sursa (job #2016696) | Cod sursa (job #2574479) | Cod sursa (job #2365705) | Cod sursa (job #35867)
Cod sursa(job #35867)
var f:text;
h,h2:byte;
n,m,i,j,k:longint;
x:int64;
a:array[1..2,-45000..45000] of word;
begin
assign(f,'diamant.in');
reset(f);
read(f,n,m,x);
close(f);
k:=(n*(n+1)*m*(m+1)) div 4;
if (x>k) or (x<-k) then begin
assign(f,'diamant.out');
rewrite(f);
writeln(f,0);
close(f);
end
else begin
a[1,0]:=1;
h:=1;
h2:=2;
for i:=1 to n do
for j:=1 to m do
begin
for k:=-45000 to 45000 do
a[h2,k]:=(a[h,k-i*j]+a[h,k+i*j]+a[h,k]) mod 10000;
h2:=h;
h:=h mod 2+1;
end;
assign(f,'diamant.out');
rewrite(f);
writeln(f,a[h,x]);
close(f);
end;
end.