Given a sheet size, say 210×197 and a number of sheets to lay out, let’s say 12 what is the algorithm that would lay them out in a way that the total width and height are as close as possible? in other words so that the sheets form a shape that is as square as possible?