We have a matrix with $$$n$$$ rows and $$$m$$$ columns, where all its values are initially set to $$$0$$$.
Additionally, we have $$$q$$$ operations of two types:
$$$*$$$ The first type of operation flips (changes $$$0$$$ to $$$1$$$ and $$$1$$$ to $$$0$$$) an entire row or column.
$$$*$$$ The second type of operation queries the sum of a submatrix.
The top-left corner of the matrix corresponds to position $$$(1, 1)$$$, and the bottom-right corner corresponds to position $$$(n, m)$$$.
The first line contains a natural number $$$t$$$ $$$(1 \le t \le 10^5)$$$, which is the number of cases.
The first line of each case contains three integers $$$n, m, q$$$ $$$(1 \le n, m, q \le 10^5)$$$, where $$$n$$$ is the number of rows, $$$m$$$ the number of columns, and $$$q$$$ the number of operations.
For each query, the first number is $$$1$$$ if a row or column is flipped, or $$$2$$$ if the sum of a submatrix is requested.
If the query is of type $$$1$$$, two more numbers $$$c$$$ and $$$d$$$ are provided. If $$$c = 1$$$, a column will be flipped, and if $$$c = 2$$$, a row will be flipped. Finally, $$$d$$$ corresponds to the index of the row or column that will be flipped, $$$(1 \le d \le n)$$$ or $$$(1 \le d \le m)$$$.
Queries of type $$$2$$$ are given by four numbers $$$a, b, c, d$$$ where $$$(a, b)$$$ represents the top-left corner and $$$(c, d)$$$ the bottom-right corner of the submatrix, $$$(1 \le a \le c \le n)$$$ and $$$(1 \le b \le d \le m)$$$.
It is guaranteed that the total sum of $$$n, m$$$, and $$$q$$$ is less than $$$10^5$$$.
For each query of type $$$2$$$, you must respond with the sum of the specified submatrix.
23 5 82 1 1 3 51 1 32 1 1 3 51 1 52 1 1 3 51 1 42 1 1 3 52 1 2 2 43 5 52 1 1 1 11 2 31 1 41 1 52 1 1 3 4
0 3 6 9 4 0 5