starter_19 problem: P_NP

i really have no idea where my greedy solution is failing… if someone can point out a test case where my submission is giving wrong answer… it would be of great help… thanks in advance!!
https://www.codechef.com/viewsolution/54920098