Sir, i am trying a question on codechef. I have written the code which works perfectly on custom input, but gives a wrong answer. I do not want the solution of the question. But I want to know what am i doing wrong. Please point out my mistake.
Link to Question:
https://www.codechef.com/START1C/problems/COUPON2
Link to my code: