Rosetta Problems

Sweet Alchemy

https://atcoder.jp/contests/arc096/tasks/arc096_d