brand new game gettin wrong answer

dynamic-programming
lunchtime

#1

Why i am gettin wrong answer , i m nt able to understand the bug here…it is givin correct for my possible test cases…i did by dp …help me !!!
Here’s the link to the solution http://www.codechef.com/viewsolution/3942843