Sir please provide hint to solve this DP problem

Hi please :pray: tell me how to solve this DP problem.

[PrepBytes]