Rosetta Problems

Puzzle of Lamps

https://atcoder.jp/contests/arc177/tasks/arc177_b