This page is still under construction.

Parts of this page are still being built. What you see may change.

Professor, your image is broken?

Interview

Time limit1sMemory limit512 MB

Summary
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 NN, find the pixel values of the enlarged picture after its width and height are increased by a factor of KK as in Figure 2 through up sampling.

Input

The first line gives the width/height NN (1 ≤ NN ≤ 10) of the square monochrome bitmap and the factor KK (1 ≤ KK ≤ 10) by which to enlarge the image.

From the second line to the (N+1)(N+1)-th line, each line gives NN pixel values.

Output

Over N×KN \times K lines, output the pixel values of the enlarged monochrome bitmap image.

Examples2

  1. Example 1

    Input
    2 2
    0 1
    1 0
    
    Expected output
    0 0 1 1
    0 0 1 1
    1 1 0 0
    1 1 0 0
    
  2. Example 2

    Input
    3 3
    1 0 1
    0 0 0
    1 0 1
    
    Expected output
    1 1 1 0 0 0 1 1 1
    1 1 1 0 0 0 1 1 1
    1 1 1 0 0 0 1 1 1
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    1 1 1 0 0 0 1 1 1
    1 1 1 0 0 0 1 1 1
    1 1 1 0 0 0 1 1 1