#P6809. [BalticOI 2010] Mines (Day2)
[BalticOI 2010] Mines (Day2)
Background
This is an output-only problem. The input is public; please see the attachments of the problem.
Problem Description
You are given an matrix . Each number in matrix is equal to the number of X in matrix at the same position plus the number of X in the eight surrounding directions of that position.
Please construct any matrix consisting of . and X that satisfies the requirement.
Input Format
The first line contains two integers , indicating the size of the matrix.
The next lines each contain integers, describing matrix .
Output Format
Output lines, each containing characters . or X, representing a matrix that satisfies the condition. This problem uses SPJ.
3 5
24531
46631
34310
.XXX.
.XX..
XX...
Hint
For of the testdata, it is guaranteed that , and a solution always exists.
Translated from BalticOI 2010 Day2 T3 Mines.
Translated by ChatGPT 5