Rosetta Problems

ICPC 2023 miền Nam - E: Exact Permutation Mapping

https://oj.vnoi.info/problem/icpc23_mn_e