uses crt;
var n,i,t,d:longINT;
tbc:real;
a:array[1..1000000000] of integer;
f,g:text;
function ktnt(x:Longint):boolean;
var j:longint;
kt:boolean;
begin
kt:=true;
for j:=2 to round(sqrt(x)) do if i mod x=0 then
begin
kt:=false;
break;
end;
ktnt:=kt;
end;
procedure docso;
begin
i:=1;
write('Nhap a[',i,']=');readln(a[1]);
if ktnt(a[1])=true then exit;
while ktnt(a[i])<>true do
begin
inc(i);
write('Nhap a[',i,']=');readln(a[i]);
end;
end;
procedure ttvtbc;
begin
n:=i;
t:=0;
for i:=1 to n do if a[i] mod 2 =0 then t:=t+a[i];
tbc:=0;
d:=0;
for i:=1 to n do if a[i] mod 2=1 then
begin
inc(d);
tbc:=tbc+a[i];
end;
tbc:=tbc/d;
end;
procedure xuatfile;
begin
assign(g,'xuat.out');rewrite(g);
writeln(g,'Tong cac so chan: ',t);
writeln(g,'Tbc cac so le: ',tbc);
close(g);
end;
begin
docso;
ttvtbc;
xuatfile;
end.