I am currently solving this [Problem](https://codeforces.me/problemset/problem/1197/D) and I am not able to understand its [editorial](https://codeforces.me/blog/entry/68615). Can someone explain it to me in simpler words ? Or if you could share some resources with me which will help me to understand this editorial, that too will be very much helpful.