BICONT Solution?

bicont
challenge
dec18

#1

I have been waiting for the editorial for this problem from December 18 long challenge :
https://www.codechef.com/DEC18A/problems/BICONT

I’ve asked for the solution on codeforces as well as on the discussion forums here. Any ideas would be highly appreciated.