#C8404. Grid Increment Operations
Grid Increment Operations
Grid Increment Operations
You are given a grid with R rows and C columns, initially filled with zeros. You are also provided with a sequence of operations. Each operation is specified by four integers \(r_1, c_1, r_2, c_2\). For each operation, every cell in the subgrid defined by the upper left coordinate \((r_1, c_1)\) and the lower right coordinate \((r_2, c_2)\) (inclusive) is incremented by 1.
Your task is to compute and print the final state of the grid after performing all the operations.
Note: The grid indices are 1-indexed.
inputFormat
The input is given from standard input (stdin) with the following format:
- The first line contains two integers \(R\) and \(C\) — the number of rows and columns of the grid.
- The second line contains an integer \(N\) — the number of operations.
- Each of the following \(N\) lines contains four integers \(r_1\), \(c_1\), \(r_2\), \(c_2\) representing an operation.
outputFormat
Print the final grid after applying all the operations. Each of the \(R\) rows should be printed on its own line, with the \(C\) integers separated by a space.
## sample3 3
0
0 0 0
0 0 0
0 0 0
</p>