Rosetta Problems

尾根 (Ridge)

https://atcoder.jp/contests/joi2017yo/tasks/joi2017yo_e