Can some one help me on how to solve this [problem](https://atcoder.jp/contests/arc066/tasks/arc066_b)?↵
↵
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.↵
↵
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.↵