8. Given integers $m \geqslant 2, n \geqslant 3$. Let the set
$$
S=\{(a, b) \mid a \in\{1,2, \cdots, m\}, b \in\{1,2, \cdots, n\}\} \text {, }
$$
$A$ be a subset of $S$. If there do not exist positive integers $x_{1}, x_{2}, y_{1}, y_{2}, y_{3}$ such that $x_{1}<x_{2}, y_{1}<y_{2}<y_{3}$, and $\left(x_{1}, y_{1}\right), \left(x_{1}, y_{2}\right), \left(x_{1}, y_{3}\right), \left(x_{2}, y_{2}\right) \in A$, find the maximum number of elements in the set $A$.
(Provided by He Yijie)
8. If a set $X$ contains a point $\left(x_{1}, y_{2}\right)$, and there are points $\left(x_{1}, y_{3}\right)$, $\left(x_{1}, y_{1}\right)$, and $\left(x_{2}, y_{2}\right)$ in $X$ above, below, and to the right of it, respectively, then $X$ is called a "center point set". Thus, the original problem is equivalent to determining the maximum number of points that can be selected from the point set $S$ such that the resulting set $A$ is not a center point set.

First, take all points in $S$ with a y-coordinate of 1 or $n$, and all points with an x-coordinate of $m$, to form the set $A_{0}$. Clearly, $A_{0}$ is not a center point set. At this point,
$$
\left|A_{0}\right|=2 m+n-2 \text {. }
$$

Next, we prove: if $A \subseteq S,|A| \geqslant 2 m+n-1$, then $A$ must be a center point set.

For $1 \leqslant i \leqslant n$, let the number of points in $A$ with a y-coordinate of $i$ be $k_{i}$. If $k_{i} \geqslant 2$, then color all points in that row except the rightmost one red. Thus, at least
$$
\left(k_{1}-1\right)+\left(k_{2}-1\right)+\cdots+\left(k_{n}-1\right)=|A|-n
$$

points are colored red.
For $1 \leqslant j \leqslant m-1$, let the number of points in $A$ with an x-coordinate of $j$ be $l_{j}$. If $l_{j} \geqslant 3$, then color all points in that column except the top and bottom ones blue; and color all points in $A$ with an x-coordinate of $m$ blue. Thus, at least
$$
\begin{array}{l}
\left(l_{1}-2\right)+\left(l_{2}-2\right)+\cdots+\left(l_{m-1}-2\right)+l_{m} \\
=|A|-2 m+2
\end{array}
$$

points are colored blue.
Notice that,
$$
\begin{array}{l}
(|A|-n)+(|A|-2 m+2) \\
=(|A|-2 m-n+1)+|A|+1>|A|,
\end{array}
$$

there must be a point that is colored both red and blue, and this point's x-coordinate is not $m$ (points with an x-coordinate of $m$ cannot be colored red).

By the coloring method, we know that this point has points above, below, and to the right of it in $A$. Therefore, $A$ is a center point set.

In summary, the maximum number of elements in set $A$ is $2 m+n-2$.