I need a function that accepts a length of the item being cut, how much the item costs, as well as a list of cuts lengths that can be made and how many of each size are needed.
The function should return the cuts that need to be made (quantity and length) and cost for each piece.
## Deliverables
There will only be one length to be cut and it will have a set cost associated with it. That cost might be 0 or more.
Each cut takes 5/32 of an inch out of the piece we are cutting.
So if you start with a 16" piece and you can only cut 4" pieces then we can get only get 3 pieces out of it (not 4) as we had to make two cuts to get our three pieces which removed 5/16" from the piece. In order to get 4 pieces out of the original it would need to be at least 16 15/32" long (3 cuts each taking 5/32" off the original)
A typical list of cuts we can choose from would look something like this
5 10"
20 2"
15 34.5"
3 18"
1 9"
There is no preference on what to cut first based on how many we can cut for each length. The only requirement with the quantities is that we don't cut more then we need.
So if we where cutting 4 19" pieces the best solution would be
3 18" pieces
4 2" pieces
1 10" piece
OR
4 10" pieces
16 2" pieces
since they both waste 1" of the original thy are both equally acceptable solutions. The thing to note with the first solution listed is that after the 3 18" pieces were cut we moved on to the 4 2" and 1 10" piece for the last square instead of cutting another 18" piece.