| OCPC 2025 Summer, Day 2: KIT Contest |
|---|
| Finished |
You have finally caught the evil Dr. Meta! Now, you plan to use one of his inventions against him: The inescapable energy prison. To power the prison, Dr. Meta built a rectangular grid with $$$n$$$ rows and $$$m$$$ columns, where a power cell can be put in each spot. You might not want to put a power cell in all of them, however, as this might overload the prison. Instead, for the prison to work properly, you need the number of power cells in the $$$i$$$th row to be divisible by $$$i$$$, and likewise, the number of power cells in the $$$j$$$th column to be divisible by $$$j$$$. Furthermore, any row or column without a power cell would lead to a catastrophic energy shortage, setting back humanity's scientific progress by centuries.
To put your plan into action, you need to figure out which spots to fill with a power cell. There is also the possibility that this invention doesn't work – after all, the trap that was supposed to teleport you to the moon didn't work either...
The input consists of:
If it is possible to power the prison, output "Yes" on one line, followed by $$$n$$$ lines with $$$m$$$ characters each: '#' if the spot of the grid should contain a power cell, and '.' otherwise.
If it is not possible, only output "No" on one line.
4 4
Yes ##.# #### .### ####
1 2
No
| Name |
|---|


