uses crt;
var a:array[1..249] of integer;
i,n,dem,t,j,tam:integer;
kt:boolean;
begin
clrscr;
write('n='); readln(n);
if (n>0) and (n<250) then
begin
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
{---------------------------cau-a---------------------------}
dem:=0;
for i:=1 to n do
if a[i] mod 2=0 then inc(dem);
writeln('so phan tu trong mang co gia tri chan la: ',dem);
{--------------------------cau-b----------------------------}
t:=0;
for i:=1 to n do
if (i mod 2=1) and (a[i] mod 2=0) then t:=t+a[i];
writeln('tong cac phan tu o vi tri le co gia tri chan cua day la: ',t);
{--------------------------cau-c--------------------------------}
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
kt:=true;
t:=a[2]-a[1];
for i:=1 to n-1 do
if a[i+1]-a[i]<>t then kt:=false;
if kt=true then writeln('day A la cap so cong')
else writeln('day A khong la cap so cong');
end
else writeln('vui long nhap lai');
readln;
end.