Rosetta Problems

お菓子の国の旅行

https://atcoder.jp/contests/arc020/tasks/arc020_4