Given a length N (e.g. 20) and an array of lengths which are all <= N (e.g. [15, 1, 6]) I'd like an algorithm that finds the minimum number of N lengths necessary to be cut into the array of lengths.
The practical application here is for ordering steel: given a design from an engineer I'd like to specify how many lengths of steel need to be ordered to build the design.
For the example above, the desired result is 2, since you could cut a single 20 foot length into 15 and 1 (leaving scrap of 4 feet), and a second 20 foot stick needed to cut into the 6 foot length with a 14 foot scrap. Notice how larger scraps are preferred.