Professor, your image is broken?
InterviewTime limit1sMemory limit512 MB
Given an N by N binary bitmap and a factor K, print the image with every pixel repeated K times in both directions.
- Level
Easy2 of 10
- Topics
- Implementation, Array, Matrix, Simulation
- Solved
- No attempts yet
Problem
In a monochrome bitmap image, each pixel that makes up the image has a color value of either 0 or 1.
A bitmap image has its size and all pixel values fixed at the moment it is created, so enlarging the image, as in Figure 1, only spreads the existing pixels wider in the direction of enlargement and does not increase the resolution.

Adding pixels to an existing image in this way to increase the total number of pixels that make up the picture is called up sampling.
There are many ways to perform up sampling, and the simplest is to keep the existing pixel arrangement unchanged and increase the count of each pixel equally.

Given the values of all pixels that make up a monochrome bitmap image whose width and height are , find the pixel values of the enlarged picture after its width and height are increased by a factor of as in Figure 2 through up sampling.
Input
The first line gives the width/height (1 ≤ ≤ 10) of the square monochrome bitmap and the factor (1 ≤ ≤ 10) by which to enlarge the image.
From the second line to the -th line, each line gives pixel values.
Output
Over lines, output the pixel values of the enlarged monochrome bitmap image.