An interesting DP question!

Now Title has done its work very fine… Coming to the Point

I was solving this problem not able to solve it … there are no editorials and successful submissions

it would be better if anyone of you guys provide an explanation to it or @vijju123 ( Problem Setter ) provide an editorial to it :slight_smile: