Can anyone please help me with this DP question?

Can anyone please help me with this question?
https://www.codechef.com/problems/AMR15B

Comments (1)