Can anybody please help me with this problem. I am not able to understand editorial also. Any other solution approaches are also welcomed. Thanks↵
↵
Problem link: [problem 40220C](https://codeforces.me/problemset/problem//420/C)
↵
Problem link: [problem 4