Rosetta Problems

Arranged Dish from a Recipe

https://atcoder.jp/contests/awc0056/tasks/awc0056_a