Link to the question: [http://discuss.codechef.com/problems/COUPON]
I was trying to solve this question. And it occurred to me that why are given (in the input), the discount we would get if we purchased the last item? I mean, we won’t need it anyway. The first test case is:
But the last line ‘0 1’ isn’t required at all, I guess. Correct me if I am wrong. My code is showing WA so maybe there is some problem in my understanding of the question.