Please tell me what’s wrong in my code in CROADS in may cook-off?

https://pastebin.com/iGMaQRtD
I had tried almost all test cases, it shows correct answer for all test cases.
But on submitting the code in codechef it shows wrong answer.

Check line number 15.

@rishup_nitdgp
That’s not a problem.