program crtg;
uses crt;
var n,i, j: integer;
A: array[1..1000] of byte;
tb: integer;
min,max: byte;
begin
clrscr;
writeln('Nhap do dai day A: '); read(n);
writeln('Nhap cac phan tu cua day: ');
for i:=1 to n do
begin
writeln('a[',i,'] = ');
repeat
read(a[i]);
until a < 100;
end;
for i:= 1 to n do
begin
if a[i] <> 1 then
begin
j:= 2;
while (a[i] mod j <> 0) do j:=j+1;
if j = a[i] then write(a[i]',');
end;
end;
tb:=0;
for i:=1 to n do
tb:=tb+a[i];
tb:=tb/n;
writeln('Gia tri trung binh cua day tren la: ',tb);
max:=a[1]; min:=a[1];
for i:=2 to n do
begin
if a[i] < min then min:=a[i];
if a[i] > max then max:=a[i];
end;
writeln('Gia tri lon nhat cua day la ',max);
writeln('Gia tri nho nhat cua day la ',min);
readln
end.