uses crt;
var i,sokm:integer;
tong:real;
begin
write('nhap so km: ');readln(sokm);
for i:=1 to n do
begin
if i=1 then tong:=tong+5000;
else if tong>=2 and tong<=5 then tong:=tong+4500;
else tong:=tong+3500;
end;
if sokm>120 then tong=(tong/10)*9;
writeln('so tien la ',tong,' dong');
readln;
end.
Var km:longint;
st:real;
Begin
write('Nhap vao so km da di ');readln(km);
if km = 1 then write('So tien la 5000');
if (km > 1) and (km<= 5) then write('So tien la ',5000+(km-1)*4500);
if (km >= 6) and (km <= 20) then write('So tien la ',5000 + 4*4500+(km-5)*3500)
if km>120 then
begin
st:=5000+4*4500+(km-5)*3500-0.1*(5000+4*4500+(km-5)*3500);
write(st:15:2);
end;
readln;
end.