Const n=10; var min,max,i:integer; p:real; a:array[1..n] of real; begin p:=1; min:=1; max:=1; for i:=1 to n do read(a[i]); for i:=1 to n do if a[i]>a[max] then max:=i else if a[i]<a[min] then min:=i; if max<min then for i:=max+1 to min-1 do p:=p*a[i] else for i:=min+1 to max-1 do p:=p*a[i]; write(p) end.
var min,max,i:integer; p:real; a:array[1..n] of real;
begin
p:=1; min:=1; max:=1;
for i:=1 to n do read(a[i]);
for i:=1 to n do if a[i]>a[max] then max:=i else if a[i]<a[min] then min:=i;
if max<min then for i:=max+1 to min-1 do p:=p*a[i] else for i:=min+1 to max-1 do p:=p*a[i];
write(p)
end.