Can anyone explain approach to AMR16A "Tim and BSTs"?

I have read the question but was unable to figure out the approach. Can anyone explain?
Also, are there any editorials to previous year ICPC questions?

Link : Contest Page | CodeChef

The editorials will be up sometime soon. Perhaps after prelims.