I am stuck around it and unable to figure out the problem ....If anyone who faced this issue or knows the solution for it ..reply in the comments,it will be really helpful. The problem is from Codeforces Educational round 95 div2 .....Here's the Problem and this is my solution implemented using Dynamic programming.