I've spent like 5+ hours trying to understand the editorial for this problem.↵
↵
It seem's like the [official editorial](https://cerc.tcs.uj.edu.pl/2013/data/cerc2013solutions.pdf) was not understandable in the first place?↵
↵
The official editorial and [jiangly's ac code](https://mirror.codeforces.com/gym/100299/submission/105303558) is all I found.↵
↵
Are there any other materials that presents this problem's solution?
↵
It seem's like the [official editorial](https://cerc.tcs.uj.edu.pl/2013/data/cerc2013solutions.pdf) was not understandable in the first place?↵
↵
The official editorial and [jiangly's ac code](https://mirror.codeforces.com/gym/100299/submission/105303558) is all I found.↵
↵
Are there any other materials that presents this problem's solution?