Algorithm for maximizing coverage of rectangular area with scaling tiles
问题 I have N scalable square tiles (buttons) that need to be placed inside of fixed sized rectangular surface (toolbox). I would like to present the buttons all at the same size. How could I solve for the optimal size of the tiles that would provide the largest area of the rectangular surface being covered by tiles. 回答1: Let W and H be the width and height of the rectangle. Let s be the length of the side of a square. Then the number of squares n(s) that you can fit into the rectangle is floor(W