You are given a chessboard of size $$$r \cdot c$$$ and a sequence of $$$q$$$ queries.
Each query consists of two integers $$$x$$$ and $$$y$$$, representing the coordinates of a cell on the chessboard. For each query:
After executing each query, report the number of cells on the chessboard where a rook can be placed such that it can attack exactly one pawn. A rook can attack a pawn if they are in the same row or column and there is no other pawn between them. The rook cannot be placed in a cell that already contains a pawn.
For example, in the image above, the rook placing at $$$(6,3)$$$ can attack the pawn at $$$(2,3)$$$ and $$$(6,5)$$$ but not the one at $$$(6,8)$$$ because there is a pawn between them.
Each test contains multiple test cases. The first line contains a single integer $$$t(1\leq t \leq 10000)$$$ — the number of test cases. The description of test cases follows.
For each test case, the first line contains $$$3$$$ integers $$$r,c,$$$ and $$$q$$$ $$$(1 \leq r, c \leq 10^9, 1 \leq q \leq 3 \cdot 10^5)$$$.
Then $$$q$$$ lines follow, in the $$$i^{th}$$$ line two integers $$$x_i, y_i (1 \leq x_i \leq r, 1 \leq y_i \leq c)$$$ are given, the cell we will place the pawn or remove it if it's already existed in the chess board.
The sum of $$$q$$$ over all test cases does not exceed $$$3 \cdot 10^5$$$.
After each query, print the number of cells in the board that a rook can be placed and can attack exactly one pawn in the board.
16 1 71 12 14 14 15 14 11 1
5 4 2 4 1 1 2
37 3 45 25 34 33 32 5 42 42 51 12 11 4 41 11 31 41 4
8 13 12 11 5 5 4 2 3 1 0 1
In the second example, the board in the first test case can be visualized as follows:
From left to right, the image displays the state of the chessboard after each query. The dots on each board represent the cell that the rook can be placed to satisfy the condition.
| Название |
|---|


