Hi everyone. I am trying to solve some of the problems from JOI. I found a very interesting one but can't understand the solution. Can somebody help me by explaining the 100 points solution. Problem link. Here you can find the solution and the code : Contest page. Thank you very much!