P13722 [GCPC 2024] Geometric Gridlock
Description
*Pentominous* is a grid logic puzzle based on the twelve pentominoes. A pentomino is a polygon formed by connecting five equal-sized squares edge to edge.
:::align{center}

Figure G.1: The twelve pentominoes (up to mirroring and rotations) and their names.
:::
The goal of this puzzle is to divide a grid into regions of size $5$ (that is, pentominoes), so that no two regions that share a side have the same shape.
You are allowed to rotate and mirror the pentominoes, but such rotations and reflections count as the same shape.
The twelve possible shapes can be seen in Figure G.1.
In a normal *Pentominous* puzzle, the player is given some pre-filled cells, for which the shape of their region is already predetermined.
In this problem, you are working with a completely blank grid of dimensions $h\times w$, and your task is to create any valid arrangement of pentominoes.
Input Format
The input consists of:
- One line with two integers $h$ and $w$ ($1 \le h,w \le 100$), the height and width of the grid.
Output Format
If there is no valid $h\times w$ *Pentominous* grid, output "$\texttt{no}$".
Otherwise, output "$\texttt{yes}$", followed by $h$ lines of width $w$ each, a possible grid using the letters from Figure G.1.
If there is more than one solution, any one of them will be accepted.
Explanation/Hint
:::align{center}
|  |  |  |
|:-:|:-:|:-:|
| Illustration of Sample Output 1. | Illustration of Sample Output 2. | Illustration of Sample Output 4. |
| [](https://puzz.link/p?pentominous/10/10/s9967k09h77j4o4o1h157jbjbj00h87k30a8s) | [](https://puzz.link/p?pentominous/10/10/s5558k95h78j4o5o3o4o42h61k88a6s) |
|:-:|:-:|
| [](https://puzz.link/p?pentominous/10/10/r44a44k4j4j7j4j44454k4o3o4o4i47r) | [](https://puzz.link/p?pentominous/10/10/s3327k22h71j1o7l1h1l1h2o21h11k7337s) |
Example *Pentominous* puzzles for you to try after the contest.
:::