uses crt;
var n,t,i,t1:integer;
begin
clrscr;
write('nhap n='); readln(n);
if (n>0) and (n<=50) then
begin
t:=0;
t1:=0;
for i:=1 to n do
begin
if i mod 2=1 then t:=t+i;
if (i mod 3=0) or (i mod 5=0) then t1:=t1+i;
end;
writeln('tong cac so le trong khoang tu 1 toi ',n,' la: ',t);
writeln('tong cac so chia het cho 3 hoac 5 trong khoang tu 1 toi ',n,' la: ',t1);
end
else writeln('vui long nhap lai');
readln;
end.