dp: stack of n boxes, find hightest depth, n^2