CAKEDOOM: Need help


For the Doom Bakes Cakes problem,

I’ve written the program correctly. But its showing wrong answer. As this is my first time, I’m guessing that it might have some other problem. Can someone point out the problem in my code ?

You CANNOT ask question like this in live contest.

Read more here.

Try to solve some easy problems in practice ( to get familiar with tester.