Build an $n \times m$ grid of zeros. Then apply $Q$ updates, each r c x setting the cell at row $r$, column $c$ (0-based) to $x$. Print the final grid, rows on separate lines, values space-separated.
Input
Line 1: $n$ $m$. Line 2: $Q$. Next $Q$ lines: r c x.
Output
Print the final $n \times m$ grid.
Example 1
Input
3 4 5 0 0 7 1 2 5 2 3 9 1 2 8 0 3 4
Output
7 0 0 4 0 0 8 0 0 0 0 9
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.