6. Partial Digest Algorithm
PLACE( L, X ) // find all solutions
if L is empty
output X
return
y Maximum element in L
If ( y, X ) L // place the cut on the right
Add y to X and remove lengths (y, X ) from L
PLACE(L, X )
Remove y from X and add lengths (y, X ) to L
If ( width-y, X ) L // place it on the left
Add width-y to X and remove lengths (width-y, X) from L
PLACE(L,X )
Remove width-y from X and add lengths (width-y, X ) to L
Return