Rosetta Problems

Chain Blackout

https://atcoder.jp/contests/awc0035/tasks/awc0035_c