Rosetta Problems

鉄道旅行 (Railroad Trip)

https://atcoder.jp/contests/joi2015ho/tasks/joi2015ho_a