program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
type Tmatrix=array [1..31,1..44] of integer;
procedure Tm (m,n:integer;Var a:TMatrix);
var
i,j:integer;
begin
writeln ('skolko strok? ');
readln (m);
writeln (' skolko stolbcov? ');
readln (n);
i:=1;
while i<=m do begin
j:=1;
repeat
a[i,j]:=random (5);
write(a[i,j]:4);
j:=j+1;
until j>n;
writeln;
i:=i+1;
end;
end;
procedure ymnoj (m,n:integer;a:TMatrix; Var b:TMatrix);
Var
i,j:integer;
begin
for j:=1 to n do
for i:=1 to m do
begin
b[i,j]:=a[i,j]*2;
write (b[i,j]:2);
end;
end;
Var m,n:integer;
a,b:TMatrix;
Begin
Tm(m,n,a);
ymnoj (m,n,a,b);
readln;
End.