Const
n = 100;
var
i, k_max, max, neg_max: integer;
a: array[1..n] of integer;
begin
for i := 1 to n do
begin
a[i] := random(100) - 50;
write(a[i], ' ');
end;
writeln();
max := a[1];
k_max := 1;
neg_max := 0;
for i := 1 to n do
begin
if a[i] > max then begin
max := a[i];
k_max := 1;
end;
if a[i] = max then k_max := k_max + 1;
if (a[i] < 0) and (abs(a[i]) > abs(neg_max)) then
neg_max := a[i];
end;
writeln('Max: ', max, ' k=', k_max);
writeln('Positive: ', max);
writeln('Negative: ', neg_max);
end.