title: find maximum sum of n elements in an array such that not more than k elements are adjacent
body: <p>Almost the same as this:
  <a href="https://stackoverflow.com/questions/11977663/find-maximum-sum-of-elements-in-an-array-such-that-not-more-than-k-elements-are">find maximum sum of elements in an array such that not more than k elements are adjacent</a></p>
  
  <p>except there is a limit of n elements we can choose. How to modify the DP algorithm to make it work for this?</p>