#P9198. 「GMOI R2-T1」轴对称

「GMOI R2-T1」轴对称

Problem Description

You have an image (matrix) with nn rows and mm columns, and the image has n×mn\times m pixels.

Initially, all pixels are black, and the RGB value is (0,0,0)(0,0,0). Each operation can change one number in the RGB of a pixel.

After each operation, please output whether the image is left-right symmetric.

Left-right symmetry: that is, for any i,ji,j, it always holds that the RGB value of the pixel in row ii, column jj is equal to the RGB value of the pixel in row ii, column mj+1m-j+1.

Input Format

The first line contains three integers n,m,qn,m,q, where qq is the number of operations.

The next qq lines each contain four integers i,j,t,ci,j,t,c, meaning to increase the tt-th number of the RGB value of the cell in row ii, column jj by cc. If any number in any RGB value exceeds 255255, it is automatically taken modulo 256256.

Output Format

After each operation, if the image is left-right symmetric, output Yes; otherwise output No. Outputs of each query are separated by newlines.

6 6 9
1 2 3 4
5 6 3 4
1 5 3 4
5 1 3 4
1 3 2 260
1 4 2 4
2 2 3 5
2 5 3 7
2 2 3 258
No
No
No
Yes
No
Yes
No
No
Yes

Hint

This problem uses bundled Subtask tests.

Subtask nn\le mm\le qq\le tt\le cc\le Corresponding test points Total score
00 1010 22 5050 11 255255 121\sim2 1010
11 100100 500500 33 10910^9 343\sim4 1515
22 100100 565\sim6
33 11 797\sim9
44 500500 101210\sim12 4545

For Subtask 2, it is guaranteed that each variable is generated uniformly at random.

For 100%100\% of the data, 1n,m1001\le n,m\le 100, 1q5001\le q\le 500, 1in1\le i\le n, 1jm1\le j\le m, t{1,2,3}t\in \{1,2,3\}, 1c1091\le c\le 10^9.

Translated by ChatGPT 5