Doubt on codeforces problem

https://codeforces.com/problemset/problem/1509/C

in this problem I canoot understand the editorial.please help