[BILLRD] Help me to find bug

My Solution: Solution: 41293394 | CodeChef

Problem: Contest Page | CodeChef

Can anybody help me to find bug in my code? My approach to the problem is correct and it is running correct for test cases.

you have applied wrong logic i guess

you can refer my code

logic was correct, you can check my code too.

@ankit80570 perhaps it might help if you explain a bit briefly what logic you used.

I have used the same logic in video lecture provided by codechef, I have also tried to debug the code by cout the points and they are correct.