$58 S=\{1,2, \cdots, n\}$ of $m(\geqslant 2)$ $r$-element subsets $A_{1}, A_{2}, \cdots, A_{m}$, have the property that for each $A_{i}(1 \leqslant i \leqslant m)$, there is an $A_{j}(1 \leqslant j \leqslant m, j \neq i)$. Either the maximum element of $A_{i}$ is the minimum element of $A_{j}$, or the minimum element of $A_{i}$ is the maximum element of $A_{j}$. Try to find:
(1) The values that $r$ can take (when $n$ is fixed).
(2) The maximum possible value of $m$ (when $n$ and $r$ are fixed).
58 (1) From $m \geqslant 2$, we know that $S$ contains at least $r+r-1=2 \cdot r-1$ elements, i.e., $n \geqslant 2 \cdot r-1$, so $2 \leqslant r \leqslant\left[\frac{n+1}{2}\right]\left(\left[\frac{n+1}{2}\right]\right.$ represents the largest integer not exceeding $\frac{n+1}{2}$ $)$. At this time, $m$ can take 2, hence $r$ can take all values from $2,3,4, \cdots,\left[\frac{n+1}{2}\right]$.
(2) Let
$$
\begin{array}{l}
S_{1}=\left\{a_{1}, a_{2}, a_{3}, \cdots, a_{r-1}\right\}, \\
S_{2}=\left\{a_{r}, a_{r+1}, a_{r+2}, \cdots, a_{n-1+1}\right\}, \\
S_{3}=\left\{a_{n-r+2}, a_{n-r+3}, \cdots, a_{n}\right\} .
\end{array}
$$

From $2 \leqslant r \leqslant\left[\frac{n+1}{2}\right]$, we know that $S_{2}$ is not an empty set. Clearly, $S_{1}$ and $S_{3}$ are both $(r-1)$-element subsets of $S$, and $S_{2}$ is an $(n+2-2r)$-element subset of $S$.
On one hand, by the property given in the problem, each $A_{i}(i=1,2,3, \cdots, m)$ cannot simultaneously contain elements from both $S_{1}$ and $S_{3}$, because no $r$-element subset can have an element from $S_{1}$ as its maximum element, nor can it have an element from $S_{3}$ as its minimum element. Therefore, either $A_{i} \subset\left(S_{1} \cup S_{2}\right)$ or $A_{i} \subset\left(S_{2} \cup S_{3}\right)$ $(i=1,2, \cdots, m)$.
On the other hand, for any $r$-element subset of $S_{1} \cup S_{2}$, there must be an $r$-element subset of $S_{2} \cup S_{3}$ that has the maximum element of the former as its minimum element; and for any $r$-element subset of $S_{2} \cup S_{3}$, there must be an $r$-element subset of $S_{1} \cup S_{2}$ that has the minimum element of the former as its maximum element. Thus, the $r$-element subsets of $S_{1} \cup S_{2}$ and $S_{2} \cup S_{3}$ satisfy the property given in the problem.
Combining the above two aspects, we find that the maximum value of $m$ is the number of all distinct $r$-element subsets of $S_{1} \cup S_{2}$ and $S_{2} \cup S_{3}$, which is $2 \cdot C_{n-+1}^{r}-C_{n+2-2 r}^{+}\left(2 \leqslant r \leqslant\left[\frac{n+1}{2}\right]\right)$.