Problem Link: http://lightoj.com/volume_showproblem.php?problem=1180&language=english&type=pdf

I have read in a blog that this particular problem involves dynamic programming with binary search. Someone kind enough please provide me an explanation on how to solve this problem using the mentioned topics.