I have a rectangle of fixed dimensions: 48 x 98.

the user inputs various rectangles. they must be less than 48x98.

these rectangles are to fit inside the 48x98 area.

they can be place vertically (if length is less than 48 only obviously) or horizontally.

if there is no more room, we put in a new rectangle of 48x98 and continue filling remaining pieces.

repeat until no more rectangles left.

my question is, what it the most efficient way to do this, to result in fewest 48x98 rectangles needed??