PROFIT?
program lol;
var
mas:array[1..20] of integer;
max,min,i:integer;
begin
randomize;
for i:=1 to 20 do
begin
mas[i]:=random(100);
writeln('Element #',i,': ',mas[i]);
end;
writeln;
for i:=1 to 20 do if mas[i] > max then max:=mas[i];
writeln('MAX: ',max);
min:=max;
for i:=1 to 20 do if mas[i] < min then min:=mas[i];
writeln('MIN: ',min);
writeln;
for i:=1 to 20 do
if (mas[i] >= min) and (mas[i] <= max) and (mas[i] mod 5 = 0) and (mas[i] <> 0) then
writeln('Element #',i,': ', mas[i]);
readln;
end.