Rosetta Problems

バームクーヘン (Baumkuchen)

https://atcoder.jp/contests/joi2014ho/tasks/joi2014ho3