I am trying to solve WESTAND problem from DEC17 long Challenge. There is no editorial for this problem and the solutions submitted are not helping either. Can someone share their approach or share some idea on how to solve this problem? I am referring to these solutions: 1) https://www.codechef.com/viewsolution/16536356 asked 29 Jul '18, 01:01

I have not gone through the question yet, but this might help: link
i have read it, its still not very clear