Rosetta Problems

ICPC 2022 miền Trung - F: Paper Bracelet

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