WA in BULBS

I dont know where I am going wrong.
Can someone help me debug or provide test cases
Code : https://www.codechef.com/viewsolution/38091409

This problem test cases were weak.

Yeah but my code should pass even though some tc were incorrect, its not passing even those or are u saying that they answers of hidden tc are wrong