const
n = 5;
m = 5;
var
a, b: array[1..n, 1..m] of integer;
c: array[1..n, 1..m] of real;
i, j, s, count: integer;
begin
for i := 1 to n do
for j := 1 to m do begin
a[i, j] := random(20);
b[i, j] := random(20);
s := s + a[i, j] + b[i, j];
inc(count);
end;
writeln('Ср. арифметическое эл.: ', s / count);
for i := 1 to n do
for j := 1 to m do begin
c[i, j] := s / count;
write(c[i, j], ' ');
if(j mod m = 0) then writeln;
end;
end.