Problem list
Log in
#coci00588 · COCI 2020/2021 Contest 6

Bold

Bronze I 1.0 s 256 MB

In addition to the usual age-related health problems such as first signs of RSI ^{1} and physical injuries that accumulate faster than they heal, Daniel’s eyesight has suddenly worsened. Paula wrote him a letter, but he can’t read it without glasses. She needs to bold the text, so Daniel can read it. The letter can be represented as a matrix consisting of characters ’.’ and ’#’. To bold it, Paula will replace each ’#’ in the original letter with a $2 \times 2$ square of ’#’ in the down-right direction.

Input

The first line contains integers $n$ and $m$ ($2 \le n$, $m \le 100$), the dimensions of the letter. Each of the following $n$ lines contains $m$ characters ’.’ and ’#’ that represent Paula’s letter. The last row and column won’t contain any ’#’.

Output

Output $n$ lines containing $m$ characters ’.’ and ’#’, representing the bold letter.

Example 1

Input
4 4
....
.#..
....
....
Output
....
.##.
.##.
....

Example 2

Input
7 7
.......
.####..
.#...#.
.#...#.
.#...#.
.####..
.......
Output
.......
.#####.
.######
.##..##
.##..##
.######
.#####.

Example 3

Input
9 7
.......
.####..
.#...#.
.#...#.
.####..
.#.....
.#.....
.#.....
.......
Output
.......
.#####.
.######
.##..##
.######
.#####.
.##....
.##....
.##....
Source
COCI 2020/2021 Contest 6
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code