Icon Scaling
Time limit2sMemory limit512 MB
Read scaling factor k and print the fixed 3x3 icon with every character expanded into a k-by-k block.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
You want to take a small icon shown on a smartphone screen and scale it up so that it looks bigger on a regular computer screen.
The icon is given as a 3 × 3 grid of the characters x and *, as follows:
*x*
xx
* *
Write a program that reads a positive integer scaling factor and outputs the scaled icon. A scaling factor of means that each character is replaced by a grid filled only with that character.
Input
The input is a single positive integer with .
Output
The output consists of lines. Each line is one line of the original icon scaled by a factor of , and it is repeated times. Scaling a line by a factor of means replacing each character in that line with copies of the character.