You have an order for 500 small widgets and 800 large widgets.
You can only make 900 widgets.
Your cost for a small widget is $2 each and your cost for a large widget is $5 each.
You can buy small widgets from John for $ 3 each and large widgets for $7 each.
John will NOT accept any order from you unless you order at least 500 units.
How do you determine how many units of each size to buy from John and how many units of each size to make yourself?