Popular Rice Recipe -- Please Help!!

I am getting wrong answer.Kindly help me identify the error.

The code is at http://www.codechef.com/viewsolution/4478816

Thank you :slight_smile:

//