P9198 "GMOI R2-T1" Axis Symmetry

Description

You have an image (matrix) with $n$ rows and $m$ columns, and the image has $n\times m$ pixels. Initially, all pixels are black, and the RGB value is $(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,j$, it always holds that the RGB value of the pixel in row $i$, column $j$ is equal to the RGB value of the pixel in row $i$, column $m-j+1$.

Input Format

The first line contains three integers $n,m,q$, where $q$ is the number of operations. The next $q$ lines each contain four integers $i,j,t,c$, meaning to increase the $t$-th number of the RGB value of the cell in row $i$, column $j$ by $c$. If any number in any RGB value exceeds $255$, it is automatically taken modulo $256$.

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.

Explanation/Hint

**This problem uses bundled Subtask tests.** | Subtask | $n\le$ | $m\le$ | $q\le$ | $t\le$ | $c\le$ | Corresponding test points | Total score | | :----------: | :----------: | :----------: | :----------: | :----------: | :----------: | :----------: | :----------: | | $0$ | $10$ | $2$ | $50$ | $1$ | $255$ | $1\sim2$ | $10$ | | $1$ | $100$ | $2$ | $500$ | $3$ | $10^9$ | $3\sim4$ | $15$ | | $2$ | $100$ | $100$ | $500$ | $3$ | $10^9$ | $5\sim6$ | $15$ | | $3$ | $100$ | $100$ | $1$ | $3$ | $10^9$ | $7\sim9$ | $15$ | | $4$ | $100$ | $100$ | $500$ | $3$ | $10^9$ | $10\sim12$ | $45$ | **For Subtask 2**, it is guaranteed that each variable is generated uniformly at random. For $100\%$ of the data, $1\le n,m\le 100$, $1\le q\le 500$, $1\le i\le n$, $1\le j\le m$, $t\in \{1,2,3\}$, $1\le c\le 10^9$. Translated by ChatGPT 5