Var
A,B:array[1..10000] of integer;
i,j,M,N:integer;
Begin
Write('N = ');ReadLn(N);
Write('Исходный массив: ');
For i:= 1 to N do
Begin
A[i]:=random(10)+1;
Write(A[i],' ');
End;
WriteLn;
Write('Полученный массив: ');
For i:= 1 to N-1 do
Begin
if A[i]>A[i+1] then M:=A[i]
else M:=A[i+1];
j:=M-1;
Repeat
j:=j+1;
Until (j mod A[i] = 0)and(j mod A[i+1] = 0);
B[i]:=j;
Write(B[i],' ')
End;
End.