#P6321. [COCI 2006/2007 #4] SKENER

[COCI 2006/2007 #4] SKENER

Background

Mirko is looking at a magazine through a magnifying glass.

Problem Description

He is looking at a magazine of rr rows and cc columns. The magnifying glass has two parameters, zr,zczr, zc, meaning that each character is converted into a matrix of zrzr rows and zczc columns.

Given the original magazine, help him find the image of the magazine under the magnifying glass.

Input Format

The first line contains four integers r,c,zr,zcr, c, zr, zc.

The next rr lines each contain cc characters. The characters may be digits, letters, or ..

Output Format

Output a matrix with r×zrr \times zr rows and c×zcc \times zc columns, representing the image under the magnifying glass.

3 3 1 2
.x.
x.x
.x. 
..xx..
xx..xx
..xx.. 
3 3 2 1
.x.
x.x
.x.
.x.
.x.
x.x
x.x
.x.
.x.

Hint

Constraints

For 100%100\% of the testdata, it is guaranteed that 1r,c501 \le r, c \le 50 and 1zr,zc51 \le zr, zc \le 5.

Notes

This problem is translated from COCI2006-2007 CONTEST #4 T2 SKENER

Translated by ChatGPT 5