Help in Atcoder Problem
Can some one help me on how to solve this problem?
Editorial is given in Japanese, i used google translater to understand it but some sentence doesn't make any sense to me and i couldn't understand solution from editorial.