a586: 4. 捷運計價問題

http://zerojudge.tw/ShowProblem?problemid=a586