Floor finishes pagination

how to create a dynamic block that creates copies, but the last dimension readjusts itself to fit the maximum dimension.
For example: I have a room measuring 1.50 x 1.50 meters.

if my wall covering is 1.00 meters x 1.00 meters, but only 1.5 full pieces and 1 half will fit, that last tile would need to be automatically readjusted to the remaining size.