multiple rectangles of different sizes are randomly distributed in a large rectangle, and these rectangles cannot overlap. (before the Ke sub-rectangle is finished, there is not enough space left for the large rectangle to put down a small rectangle, but we need to know the current number.)
small rectangles randomly distributed like this do not overlap. How to implement such an algorithm?