Rosetta Problems

ICPC 2022 miền Bắc - F: GIFT

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