CAKEDOOM: Need help

Hi,

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 ?

http://www.codechef.com/viewsolution/1099545

You CANNOT ask question like this in live contest.

Read more here.

Try to solve some easy problems in practice (http://www.codechef.com/problems/easy) to get familiar with tester.

//