uses crt;
var a:array[1..100]of integer;
n,i,t,t1:integer;
begin
clrscr;
write('Nhap so phan tu:'); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
t1:=0;
for i:=1 to n do
begin
if a[i] mod 2=0 then t:=t+sqr(a[i])
else t1:=t1+sqr(a[i]);
end;
writeln('Tong binh phuong cac so chan la: ',t);
writeln('Tong binh phuong cac so le la: ',t1);
readln;
end.