"It’s nearing the end of the semester and you have n final projects to complete. Your goal, of course, is to maximize your total grade on these projects! For simplicity, say that you have a total of H hours (a positive integer) to work on the projects cumulatively, and you’ll spend an integer number of hours on each project.
To figure out how best to divide up your time, you’ve come up with a set of non-decreasing estimate functions {e1, e2, . . . , en}, one for each project: if you spend h hours on project i (where 0 <= h <= H), you’ll get a grade of ei(h) on that project.
Give a dynamic programming algorithm that takes the estimate functions {e1, . . . , en} as input and that generates non-negative numbers of hours {h1, . . . , hn} such that (h1 +h2 +· · ·+hn) = H and your total grade (e1(h1) + e2(h2) + · · · + en(hn)) is maximum. For full marks, justify your recurrence, and briefly analyze your algorithm’s running time."
e1(0)=...=en(0)=0
? – Codor