Rosetta Problems

バスの乗り継ぎ (Bus Tour)

https://atcoder.jp/contests/joisc2013-day1/tasks/joisc2013_bustour