Rosetta Problems

Good Permutation

https://atcoder.jp/contests/arc167/tasks/arc167_d