uses crt;
var i,n,c,b,uc:integer;
bcnn:int64;
a:array[1..100] of integer;
{--------------------------chuong-trinh-con-tim-ucln-cua-hai-so---------------}
function ucln(c,b:integer):integer;
var r:integer;
begin
r:=c mod b;
while r<>0 do
begin
c:=b;
b:=r;
r:=c mod b;
end;
ucln:=b;
end;
{---------------------------chuong-trinh-chinh-----------------------------------}
begin
clrscr;
Write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
{------------------------------xu-ly--------------------------}
writeln;
uc:=ucln(a[1],a[2]);
bcnn:=(a[1]*a[2])div uc;
for i:=3 to n do
begin
uc:=ucln(uc,a[i]);
bcnn:= bcnn*a[i] div uc;
end;
Writeln('uoc chung lon nhat cua day so la: ',uc);
Writeln('boi chung nho nhat cua day so la: ',bcnn);
readln
end.
var a:array[1..32000] of integer;
i,chan,le,t,s:integer;
begin
write('nhap n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
a, chan:=0;
for i:=1 to n do if a[i] mod 2 = 0 then chan:=chan+1;
writeln('so so chan trong day la:',chan);
b, le:=0;
for i:=1 to n do if a[i] mod 2 = 1 then le:=le+1;
writeln('so so le trong day la:',le);
c, t:=0;
for i:=1 to n do if a[i] mod 2=0 then t:=t+a[i];
write('tong cua ptu chan la:',t);
d, s:=0;
for i:=1 to n do if a[i] mod 2=1 then s:=s+a[i];
write('tong cua ptu le la:',s);