Online Shopping: Question

Link to the question: [http://discuss.codechef.com/problems/COUPON][1]

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:

2 2

3 4

1 2

1 0

0 1

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.
[1]: http://discuss.codechef.com/problems/COUPON

1 Like

The discounts offered by the last row of shops do not matter.

There is no point in considering them.

There is no reason why it should be given , actually :stuck_out_tongue:

You haven’t misinterpreted the question .

1 Like