a583: 1. 座位距離計算問題

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