What to do?

Can anyone provide me more test cases for the question shop of spoj

Can you give link to your code, so that we can think of where your code is going wrong and for which case your code fails . It may be useless to post unnecessary test cases for which your code may give correct answer.

My suggestion is that first try some cases of your own using pen and paper, and think of some corner cases

Its after a long time someone has even bothered to reply thanks buddy for replying posting the code