Var A:array[1..10000] of integer;
i,NOD,NOK,k,N:integer;
Begin
Write('N = ');ReadLn(N);
Write('Введите числа (',N,' шт.): ');
For i:= 1 to N do
Read(A[i]);
{Поиск НОК}
NOK:=abs(A[1]);
For i:= 2 to N do
if abs(A[i])if NOK = 0 then NOK:=1;
Repeat
k:=0;
For i:= 1 to N do
if A[i] mod NOK = 0 then k:=k+1;
NOK:=NOK-1;
Until k=N;
WriteLn('NOK = ',NOK+1);
{Поиск НОД}
NOD:=A[1];
For i:= 2 to N do
if abs(A[i])>NOD then NOD:=A[i];
Repeat
k:=0;
For i:= 1 to N do
if NOD mod A[i] = 0 then k:=k+1;
NOD:=NOD+1;
Until k=N;
WriteLn('NOD = ',NOD-1)
End.