uses crt;
var i,n,dem:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until n>0;
writeln('Cac so chan va chia het cho 4 trong khoang tu 5 toi ',n,' la: ');
for i:=5 to n do
if (i mod 2=0) and (i mod 7=0) then write(i:4);
writeln;
writeln('Cac so chia het cho 7 trong khoang tu 5 toi ',n,' la: ');
dem:=0;
for i:=5 to n do
if i mod 7=0 then
begin
write(i:4);
inc(dem);
end;
writeln;
writeln('Co ',dem,' so chia het cho 7 trong khoang tu 5 toi ',n);
readln;
end.