Amazon interview question

Write a function to allocated two dimensional rectangles within a larger area.