Continuing the discussion from BINADD - Guideline to Upsolve after contest:
Facing a Tle in the 3rd substask
where is your code?
https://www.codechef.com/viewsolution/28612591
Refer to this discussion thread: BINADD - Editorial - #24 by striker22