through the random generation of these div modules, as shown in the figure, the minimum, (div is the smallest in the figure), the number is random, to ensure that it can finally be assembled into a rectangle, as shown in the figure, how to do this requirement? I would like to ask all the bosses, thank you ~