uses crt;
var b:array[1..100]of integer;
n,i,t,t1,max,min,t2:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('B[',i,']='); readln(b[i]);
end;
t:=0;
for i:=1 to n do
if b[i] mod 2=0 then t:=t+b[i];
writeln('Tong cac so chan trong day la: ',t);
t1:=0;
for i:=1 to n do
if b[i]<0 then t1:=t1+b[i];
writeln('Tong cac so am trong day la: ',t1);
max:=b[1];
min:=b[1];
for i:=1 to n do
begin
if max<b[i] then max:=b[i];
if min>b[i] then min:=b[i];
end;
writeln('Phan tu lon nhat la: ',max);
writeln('Phan tu nho nhat la: ',min);
t2:=0;
for i:=1 to n do
if b[i] mod 3=0 then t2:=t2+b[i];
writeln('Tong cac phan tu chia het cho 3 la: ',t2);
readln;
end.