title: Finding cheapest combination of items with conditions on the selection
body: <p>Lets say that I have 3 sellers of a particular item. Each seller has different amounts of this items stored. The also have a different price for the item.</p>
  
  <pre>
  <strong>Name</strong>            <strong>Price</strong>      <strong>Units in storage</strong>
  Supplier #1     17$        1 Unit
  Supplier #2     18$        3 Units
  Supplier #3     23$        5 Units
  </pre>
  
  <p>If I do not order enough items from the same supplier, I have to pay some extra costs <strong>per unit</strong>. Let's say, for example, that if I do not order at least 4 units, I do have to pay extra 5$ for each unit ordered.</p>
  
  <h2>Some examples:</h2>
  
  <p>If I wanted to buy 4 units, the best price would come from getting them from <strong>Supplier #1</strong> and <strong>Supplier #2</strong>, rather than getting it all from <strong>Supplier #3</strong></p>
  
  <pre><code>(17+5)*1 + (18+5)*3 = 91                 &lt;--- Cheaper
              23   *4 = 92
  </code></pre>
  
  <p>But if I were to buy 5 units, getting them all from <strong>Supplier 3</strong> gives me a better price, than getting first the cheaper ones and the rest from more expensive suppliers</p>
  
  <pre><code>(17+5)*1 + (18+5)*3 + (23+5)*1 = 119
                         23   *5 = 115$    &lt;--- Cheaper
  </code></pre>
  
  <h2>The question</h2>
  
  <p>Keeping all this in mind... If I knew beforehand how many items I want to order, what would be an algorithm to find out what is the best combination I can chose?</p>