What is the maximum number of objects that can fit in a NxN matrix without overlapping?

72 Views Asked by At

given that I have a symmetric "NxN" matrix, what is the maximum number of objects of size "X" that can fit in it?

So, for example, for a 4x4 matrix, with objects of size 3, I'd say 5 by calculating it manually:

(+|+|+)(+)

(+|+|+)(+)

(+|+|+)(+)

(+|+|+)|-|

Thank you

1

There are 1 best solutions below

0
On

As long as the objects don't have to have any particular shape, you can fit $\left \lfloor \frac {N^2}X \right \rfloor$ of them. In your example this is $\left \lfloor \frac {4^2}3 \right \rfloor=5$. If the shape is specified, you might not be able to fit that many. Given a $4 \times 4$ grid, you can't fit any $1 \times 5$ rectangles at all, but you can fit three $P$ pentominoes.