uses crt;
var n,t:int64;
dem,i:integer;
begin
clrscr;
repeat
write('nhap n='); readln(n);
until (0<n) and (n<1000000000);
writeln('Cac so chinh phuong trong khoang tu 1 toi ',n,' la: ');
dem:=0;
t:=0;
for i:=1 to n do
if sqrt(i)=trunc(sqrt(i)) then
begin
write(i:6);
inc(dem);
t:=t+i;
end;
writeln;
writeln('So so chinh phuong trong khoang tu 1 toi ',n,' la: ',dem);
writeln('Tong cac so chinh phuong trong khoang tu 1 toi ',n,' la: ',t);
readln;
end.