title: Find the best way to buy p Product from limit x Vendors
body: <p>I <strong>have to buy</strong> 100 Products ( or p Products) from 20 Vendors ( or v Vendors). Each Vendors have all of these Products, but they sell different Price. </p>
  
  <p><img src="https://i.stack.imgur.com/fdlUU.jpg" alt="http://i.stack.imgur.com/oaupb.jpg  &lt;&lt; Image description. Sorry, I can not post Image because I&#39;m a new user."></p>
  
  <p>I want to find the best price to get 100 Products. Asume that there is no Shipping Cost.
  There are v^p ways. And I will get only one way that have best Price.
  The problem seem to be easy if there is no requirement: LIMIT number of Vendors to x in the Orders because of Time Delivery ( or Some reasons).</p>
  
  <p>So, the problem is: Find the best way to buy p Product from limit x Vendors ( There are v Vendors , x&lt;=v).</p>
  
  <p>I can generate all Combination of Vendors( There are C(v,x) combinations) and compare the Total Price. But There are so many combinations . (if there are 20 Vendors, there are around 185k combinations).
  I stuck at this idea. 
  Someone has same problem , pls help me. Thank you very much.</p>