Rosetta Problems

Revenge of the Broken Door

https://atcoder.jp/contests/jag2017autumn/tasks/jag2017autumn_d