I didn't understand the editorial of the question.
https://mirror.codeforces.com/contest/1941/problem/G
Can anyone help me to get an idea of the solution, and why they are using these techniques to get the solution? How by using this we are getting the required answer.