Frames
InterviewTime limit1sMemory limit1024 MB
Draw n rectangle borders on an h by w grid in input order, marking the i-th frame with the i-th letter, and print the final picture.
- Level
Easy3 of 10
- Topics
- Implementation, Simulation
- Solved
- No attempts yet
Statement
Senya decided to write an operating system. To start, he plans to write a subroutine that draws window frames.
The drawing field is a rectangle of pixels. Rows are numbered from 1 to from top to bottom, and columns are numbered from 1 to from left to right.
The frames are drawn on the field one after another. The -th frame is the border of a rectangle with opposite corners at and .
Input
The first line contains integers , , and , the field size and the number of frames (, ). Each of the next lines contains four integers , , , and (, ).
Output
Print the image produced by the frames described in the input as rows of characters each. A pixel not used by any frame is printed as .. A pixel of the -th frame is printed with the -th Latin letter, so the first frame uses a, the second uses b, and so on.