title: Maximum number of apples that can be collected
body: <p>A monk initially at his house moves sequentially from one farm to other.There are a total of N farms.</p>
  
  <p><strong>House->1st farm->2nd farm-> ... ->Nth farm</strong></p>
  
  <p>Running from one farm to the next one consumes a single unit of Monk's current energy.
  Initially Monk is at his house, and to move to the first farm it shall take him one unit of energy. </p>
  
  <p>You are given the arrays <strong>milk[N]</strong> and <strong>apples[N]</strong> and the monk's initial energy <strong>P</strong>(at house).   </p>
  
  <p>At each farm, Monk has one choice either to take milk ( for increasing his energy by amount of <strong>milk[i]</strong>) or apples from the farm. Monk is allowed to take only either the entire amount of Milk or the entire amount of apples and not none or both.  </p>
  
  <p>By following so, what is the maximum number of apples Monk can collect, always having non-negative energy ?  </p>
  
  <p>Example:   </p>
  
  <pre><code>N = 3   
  P = 2  
  milk = {1, 2, 1}  
  apples = {100, 1, 100}
  
  ans = 200
  </code></pre>
  
  <p>Any approach or algorithm to solve the above question..</p>