uses crt;
var A:array [1..350] of integer;
n,i,s,dem,sch,x,demx:integer;
begin
clrscr;
write('Nhap n: '); readln(n);
write('Nhap x: '); readln(x);
s:=0; dem:=0; sch:=0; demx:=0;
for i:=1 to n do
begin
write('Nhap phan tu thu ',i,': ');
readln(A[i]);
s:=s+A[i];
if A[i]<0 then inc(dem);
if A[i] mod 2 = 0 then sch:=sch+A[i];
if A[i] = x then inc(demx);
end;
for i:=1 to n do write(A[i]:4);
writeln;
writeln('Tong cac phan tu trong day la: ',s);
writeln('Co ',dem,' so hang la so nguyen am');
writeln('Tong cac so chan la: ',sch);
writeln('So luong cac phan tu bang ',x,': ',demx);
readln
end.