title: Algorithm Question Maximize Average of Functions
body: <p>I have a set of N non-decreasing functions each denoted by F<sub>i</sub>(h), where h is an integer. The functions have numeric values.</p>
  
  <p>I'm trying to figure out a way to <em>maximize</em> the average of all of the functions given some total H value. </p>
  
  <p>For example, say each function represents a grade on an assignment. If I spend h hours on assignment i, I will get g = F<sub>i</sub>(h) as my grade. I'm given H hours to finish all of the assignments. I want to maximize my average grade for <em>all</em> assignments.</p>
  
  <p>Can anyone point me in the right direction to figure this out? I just need a generic algorithm in pseudo code and then I can probably adapt quickly from that.</p>
  
  <p>EDIT: I think dynamic programming could be used to figure this out but I'm not really 100% sure.</p>
  
  <p>EDIT 2: I found an example in my algorithms book from when I was in university that is almost the exact same problem <a href="http://books.google.ca/books?id=97GV7qegxJ8C&amp;lpg=PA329&amp;ots=LXSlOHYQCI&amp;pg=PA329#v=onepage&amp;q=&amp;f=false" rel="nofollow noreferrer">take a look here on Google Books</a>.</p>