I'm trying to do MCHEF from codechef long july 2015 . I've tried to implement what is written in the editorial but i'm constantly getting tle , The complexity of my solution seems to be enough to pass the constraints.Why am i getting TLE?? help !!
LINK TO CODE- http://pastebin.com/T5ZxchXL