ВУЗ:
Составители:
79
begin
l:=i;
fl:=f[i];
ko:=k*3-2;
k:=ko;
end;
end;
end;
end;
repeat
fh:=-1e+20;
fl:=1e+20;
for i:=1 to n+1 do
begin
if f[i]>fh then
begin
fh:=f[i];
h:=i;
end;
if f[i]<fl then
begin
fl:=f[i];
l:=i;
end;
end;
fg:=-1e+20;
for i:=1 to n+1 do
begin
if i<>h then
if f[i]>fg then
begin
fg:=f[i];
g:=i;
end;
end;
for j:=1 to n do
begin
xo[j]:=0;
80
for i:=1 to n+1 do
xo[j]:=xo[j]+s[i,j];
xo[j]:=(xo[j]-s[h,j])/n;
xh[j]:=s[h,j];
xg[j]:=s[g,j];
xl[j]:=s[l,j];
end;
for j:=1 to n do
xr[j]:=2*xo[j]-xh[j];
functmin(fr,xr);
if fr<fl then
begin
for j:=1 to n do
xe[j]:=2*xr[j]-xo[j];
functmin(fe,xe);
if fe<fr then choice(fe,xe)
else choice(fr,xr)
end
else
begin
if fr>fg then
begin
if fr<fh then choice(fr,xr)
else
begin
for j:=1 to n do
xc[j]:=(xh[j]+xo[j])/2;
functmin(fc,xc);
if fc>fh then
begin {}
for i:=1 to n+1 do
begin
for j:=1 to n do
begin
s[i,j]:=(s[i,j]+xl[j])/2;
x[j]:=s[i,j];
end;
functmin(f[i],x);
begin for i:=1 to n+1 do
l:=i; xo[j]:=xo[j]+s[i,j];
fl:=f[i]; xo[j]:=(xo[j]-s[h,j])/n;
ko:=k*3-2; xh[j]:=s[h,j];
k:=ko; xg[j]:=s[g,j];
end; xl[j]:=s[l,j];
end; end;
end; for j:=1 to n do
end; xr[j]:=2*xo[j]-xh[j];
repeat functmin(fr,xr);
fh:=-1e+20; if frfh then functmin(fe,xe);
begin if fefg then
fl:=f[i]; begin
l:=i; if frh then if fc>fh then
if f[i]>fg then begin {}
begin for i:=1 to n+1 do
fg:=f[i]; begin
g:=i; for j:=1 to n do
end; begin
end; s[i,j]:=(s[i,j]+xl[j])/2;
for j:=1 to n do x[j]:=s[i,j];
begin end;
xo[j]:=0; functmin(f[i],x);
79 80
