Rosetta Problems

Snuke the Cookie Picker

https://atcoder.jp/contests/abc305/tasks/abc305_c