smoothie-web Problems Contests Ranking About
Login Register

BSSPC 2019 P2 - Drawing

data_usage Points
1
timer Time Limit
linear_scale Memory Limit
Created
1586405089078

Problem Statement

Drawing can be hard.

Devin is trying to draw a picture on his computer, but he does not know how to use a graphics editor.

Help him out by making a program to turn his instructions into a picture!

Input Specification

The first line will contain the integer XX and YY (1X,Y1001 \le X, Y \le 100), with XX being the width of the canvas, and YY being the height.

The second line will contain the integer NN (1N<100001 \le N < 10000), which is the number of spots on the canvas he wants you to fill in.

The following N lines will contain the integers xx and yy, and character cc, where xx and yy is the location on the canvas Devin wants you to fill, and cc is the character to put at that spot.

Note: The locations given (xx and yy) start at 0, with (0,0)(0, 0) being the top-left most corner. xx is the location along the width of the canvas, and yy is the location along the height of the canvas.

Output Specification

Display the full canvas. Be sure to also output spaces where there is no character being filled.

Sample Input #1

5 1
3
0 0 a
2 0 r
4 0 t

Sample Output #1

a r t

Sample Input #2

8 3
15
3 0 _
1 1 _
2 1 [
3 1 _
4 1 ]
5 1 =
6 1 =
7 1 =
0 2 (
1 2 _
2 2 _
3 2 _
4 2 _
5 2 _
6 2 )

Sample Output #2

   _
_[_]===
(_____)