COCI '20 Contest 6 #1 Bold

View as PDF

Submit solution


Points: 5 (partial)
Time limit: 1.0s
Memory limit: 512M

Problem type

In addition to the usual age-related health problems such as first signs of repetitive strain injury 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 Specification

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 Specification

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

Sample Input 1

4 4
....
.#..
....
....

Sample Output 1

....
.##.
.##.
....

Sample Input 2

7 7
.......
.####..
.#...#.
.#...#.
.#...#.
.####..
.......

Sample Output 2

.......
.#####.
.######
.##..##
.##..##
.######
.#####.

Sample Input 3

9 7
.......
.####..
.#...#.
.#...#.
.####..
.#.....
.#.....
.#.....
.......

Sample Output 3

.......
.#####.
.######
.##..##
.######
.#####.
.##....
.##....
.##....

Comments

There are no comments at the moment.