Rosetta Problems

Painting with Many Orders

https://atcoder.jp/contests/kupc2021/tasks/kupc2021_b