Here's the situation:

You have several rectangles of various heights. All are the same width - doesn't matter.

The top (Y position) of each rectangle is fixed - it can't be changed. If you were to put these rectangles in one column, many of them would overlap. That is not allowed.

Your job is to arrange the rectangles into the fewest number of columns possible.

OK, that's my job, but I don't know how to do it programically, so I need help. Anyone know how to do this?