For i:= 1 to n do
begin
mas [ i ] := random(100);
if mas [ i ] < 50 then begin
sum1:= sum1 + mas [ i ] ;
inc(count1);
end
else begin
sum2:= sum2 + mas [ i ] ;
inc(count2);
end;
if coun1 >0 then writeln('result1 = ',sum1/count1);
if coun2 >0 then writeln('result2 = ',sum2/count2);
for i:= 1 to n do
if mas [ i ] = x then writeln(A[', i,'] );
end;