#P10266. 高效清理
高效清理
Background
A design concept diagram of the cleaning bomb:

Problem Description
Mahiro's room is too large, but as a shut-in, she is too lazy to clean it, so Mihari invented a cleaning bomb for Mahiro to use.
Mahiro's room consists of tiles arranged in rows and columns. The amount of dust on the tile in row and column is .
Mahiro will use the cleaning bomb times. In the -th use, she uses a cleaning bomb with energy value on the tile at row , column . This decreases the dust on by , decreases the dust on the tiles in the first outer ring around by , decreases the dust on the tiles in the second outer ring by , , and decreases the dust on the tiles in the -th outer ring by .
Of course, the dust amount cannot be negative, so if before an operation, the dust on a tile is smaller than the amount it should be decreased by, then its dust amount becomes .
Please output the dust amount on each tile after Mahiro finishes using the cleaning bomb times.
Input Format
The first line contains three integers , representing the number of tile rows, tile columns, and the number of operations.
Next, there are lines, each containing integers. The integer in row and column is , describing the dust amount on each tile.
Next, there are lines. The -th line contains three integers , describing one operation.
Output Format
Output lines, each containing integers. The integer in row and column represents the final dust amount on tile .
4 5 2
7 5 4 6 5
2 4 7 9 5
6 4 5 3 5
1 2 3 0 7
2 4 2
3 3 2
7 5 3 5 4
2 3 5 4 4
6 3 0 1 4
1 1 2 0 7
6 7 3
6 4 7 8 4 6 1
4 5 4 6 7 5 9
1 4 3 0 7 1 3
4 6 0 7 9 0 0
1 2 3 4 4 5 8
4 7 6 8 7 4 9
5 5 3
2 3 4
3 6 2
2 0 0 0 0 5 1
0 0 0 0 2 3 8
0 0 0 0 1 0 1
0 2 0 0 0 0 0
0 1 1 0 0 0 7
4 7 5 4 3 0 8
Hint
Sample Explanation
In the first operation, a “cleaning bomb” with energy value is used on tile , which decreases the dust on by , and decreases the dust on by .
In the second operation, a “cleaning bomb” with energy value is used on tile , which decreases the dust on by , and decreases the dust on by .
Constraints
For all testdata, , , , , .
This problem has test points and uses bundled tests. The subtasks and test point allocation are as follows:
| Subtask ID | Test Point ID | Special Property | Score |
|---|---|---|---|
| No special limits |
Translated by ChatGPT 5