whats wrong with the code for the question ID : COPS

https://www.codechef.com/viewsolution/64309362

please tell me the problem with my code.

One test case where your code fails is if there is only one police:
1
1 10 2
50

The ans should be 1-29 and 71 - 100, so, 58, but your code outputs 0.

still there might be some more testcases for this question right

thanks for the hint bro