Rosetta Problems

毒蛇の脱走 (Snake Escaping)

https://atcoder.jp/contests/joi2018ho/tasks/joi2018ho_e