This is the problem asked in yesterday contest of codeforces, I try my best to solve but I m unable to solve it, and I requested to Please see my SOLUTION and then DEBUG my Code.
IT basically gives WA on Test case 3
Please go through it once and help me.