Const nx=20;mx=20;
var n,m,i,j,min,max,s:integer;
A:array[1..nx,1..mx] of integer;B:array[1..nx] of integer;
begin
write('Введите n и m');Read(n,m);max:=-100;min:=100;
for i:=1 to n do begin
for j:=1 to n do begin
A[i,j]:= random(50)-25;
if max < A[i,j] then max := A[i,j];
if min > A[i,j] then min := A[i,j];
write(A[i,j]:4); end;
writeln;
s:= max + min;
B[i]:= s;
max:=-100;min:=100; end;writeln;
for i:=1 to n do begin
write(B[i]:4); end; end.