Pentominos |
A pentomino consists of five equal-sized squares attached edge-to-edge to form some shape. There are twelve possiblepentominos that can be formed in this way (plus their reflections and rotations). A few pentominos are shown below:
XXXXX XXXX XXXX X X X XXX X
Something that has been keeping people occupied since the late 50's is to find a way to form a rectangle of a given size using the 12 different pentominos
The program must determine if it is possible to cover the remaining 60 cells using the 12 different types of pentominos. The solution may use a given type of pentomino more than once, or not at all. The output from the program will show the square filled with pentominos. Each pentomino in the output must be drawn using a different character from `a' to `l'. The blocked cells should be drawn using the `*' character.
Your program needs to only find one solution. If no solution exists, ``No solution." should be printed.
Print a blank line between datasets.
1 3 5 4 5 5 5 6 5
aaaaabcc deeebbbc ddde*bcc ffde*ggg hffi*ggj hfii*jjj hiikkklj hhkkllll