Rosetta Problems

Prediction and Restriction

https://atcoder.jp/contests/abc149/tasks/abc149_d