Dukelin's answer is wrong. Considering a 5 * 5 floor and 8 1 * 3 tiles. The only way to put all the tiles on the floor:
AAACD BBBCD EF.CD EFGGG EFHHH
And this cannot be achieved by replacement.
Then how to do it? I have done a lot of mathematical work and I know well. I will give you some hint:
- Put 1 * 3 tiles first and place 1 * 3 so that we can put 1 * 2 as much as possible (in fact, suppose there are n unclosed floor tiles, so we can put the floor (n / 2) 1 * 2 tiles).
- Be careful with some corner cases. For example, all tiles are 1 * 3, floor 1 * 10, and floor 2 * 10, etc.
If you have any problems, leave me a comment.
user2410602
source share