program fantscrin;
var a,c: array [1..1000] of integer;
i,n,s,j:integer;
Begin
write('N = '); readln(n);
s:=0;
for i:=1 to n do
begin
write('c[',i,'] = '); readln(c[i]);
s:=s+c[i];
end;
writeln('S = ', s);
j:=0;
if c[i] > s / n then
j:= j + 1;
a[j]:= c[i];
for i:=1 to j do
write(a[i], ' ')
End.
program fantscrin;
var a,c: array [1..1000] of integer;
i,n,s,j:integer;
Begin
write('N = '); readln(n);
s:=0;
for i:=1 to n do
begin
write('c[',i,'] = '); readln(c[i]);
s:=s+c[i];
end;
writeln('S = ', s);
j:=0;
for i:=1 to n do
if c[i] > s / n then
begin
j:= j + 1;
a[j]:= c[i];
end;
for i:=1 to j do
write(a[i], ' ')
End.