how to solve this question?
https://www.codechef.com/MAY221B/problems/ITGRZN
[ID] 2023 ICPC World Finals Luxor
The 2023 ICPC World Finals Luxor
ICPC World Finals Luxor Mirror Contest with Petr and ksun48