title: Knapsack 0/1 algorithm - unlimited resources
body: <p>I've run into a thinking trouble and I'm just frustrated. I have a working algorithm of the knapsack problem, using dynamic programming, where I specify </p>
  
  <ul>
  <li>Max load</li>
  <li>Items (their weight)</li>
  </ul>
  
  <p>and the algorithm calculates the optimal fill of the knapsack using those items. But now I need to fill it <em>completely</em>, using <em>least</em> items, but I have unlimited amount of each item. (Those items have weights <code>{1; w1; w2; ...}</code> so it is always possible to complete).</p>
  
  <p>How do I fit this in the 'classic' algorithm?</p>
  
  <p>Thanks</p>