13. (China Mathematical Olympiad 2001) Let $a=2001$. Let $A$ be the set of all pairs of positive integers $(m, n)$ satisfying the following conditions:
(1) $m<2 a$;
(2) $2 n \mid\left(2 a m-m^{2}+n^{2}\right)$;
(3) $n^{2}-m^{2}+2 m n \leqslant 2 a(n-m)$.
Let $f=\frac{2 a m-m^{2}-m n}{n}$, find $\min _{(m, n) \in A} f$ and $\max _{(m, n) \in A} f$.
13. (A) First, find the minimum value of $f$. Let
$p=\frac{2 a m-m^{2}+n^{2}}{2 n}$.
(1)
From conditions (1) and (2), we know that $p$ is a positive integer and
$(2 a-m) m=(2 p-n) n$.
From (1), we have $2-m>0$, so from (2), we know $2 p-n>0$.
From condition (3), we get
$2 a m-m^{2}+n^{2}=2 a m-2 m n+2 m n-m^{2}+n^{2} \leqslant 2 a m-2 m n+2 a(n-m)=2 n(a-m)$.
Thus, from the definition of $p$ (1), we have $p \leqslant a-m$. Therefore,
$2 p-nm$.
(3)
Let $(m, n) \in A$, and let $n^{\prime}=2 p-n=\frac{2 a m-m^{2}}{n}$.
Then, $n^{\prime}$ is also a positive integer, and it is easy to verify that
$(m, n) \in A \Leftrightarrow\left(m, n^{\prime}\right) \in A$.
In fact, in (1), if we replace $p$ and $n$ with $p^{\prime}$ and $n^{\prime}$, we have
$$
\begin{aligned}
p^{\prime}= & \frac{2 a m-m^{2}+n^{\prime 2}}{2 n^{\prime}}=\frac{2 a m-m^{2}}{2 n^{\prime}}+\frac{n^{\prime}}{2} \\
& =\frac{n}{2}+\frac{1}{2} \cdot \frac{2 a m-m^{2}}{n}=\frac{2 a m-m^{2}+n^{2}}{2 n}=p
\end{aligned}
$$

This shows that $p$ is a positive integer if and only if $p^{\prime}$ is a positive integer, i.e., the condition (2) for $\left(m, n^{\prime}\right)$ holds if and only if the condition (2) for $(m, n)$ holds.
$$
\begin{array}{l}
\text { On the other hand, for the condition (3) of }\left(m, n^{\prime}\right), \text { we have } \\
n^{\prime 2}-m^{2}+2 m n^{\prime}-2 a\left(n^{\prime}-m\right) \\
=\left(\frac{2 a m-m^{2}}{n}\right)^{2}-m^{2}+2 m \cdot \frac{2 a m-m^{2}}{n}-2 a\left(\frac{2 a m-m^{2}}{n}-m\right) \\
=\left(\frac{2 a m-m^{2}}{n}\right)^{2}+\left(2 a m-m^{2}\right)+\frac{2\left(2 a m-m^{2}\right)}{n}(m-a) \\
=\frac{2 a m-m^{2}}{n^{2}}\left[\left(2 a m-m^{2}\right)+n^{2}+2 n(m-a)\right] .
\end{array}
$$

From condition (1), we know that the condition (3) for $\left(m, n^{\prime}\right)$ holds if and only if the condition (3) for $(m, n)$ holds, which proves
$\left(m, n^{\prime}\right) \in A \Leftrightarrow(m, n) \in A$.
Thus, from the definition of $n^{\prime}$, when $(m, n) \in A$, we have
$$
f(m, n)=\frac{2 a m-m^{2}-m n}{n}=n^{\prime}-m, f\left(m, n^{\prime}\right)=\frac{2 a m-m^{2}-m n^{\prime}}{n^{\prime}}=n-m \text {. }
$$

From (3), we know that when $(m, n) \in A$, we have
$f(m, n)=n^{\prime}-m \geqslant 2$.
Let $m=2$, then condition (2) becomes
$2 n \mid 4 a-4+n^{2}$,
i.e., $\frac{4000}{n}+\frac{n}{2}$ is a positive integer. At this time, condition (3) becomes
$$
n^{2}-3998 n+8000 \leqslant 0 \text {. }
$$

Solving this, we get
$$
1999-\sqrt{1999^{2}-8000} \leqslant n \leqslant 1999+\sqrt{1999^{2}-8000} .
$$

Thus,
$3 \leqslant n \leqslant 3995$.
This shows that $(2, n) \in A$ is equivalent to $n \in[3,3995]$ and being an even divisor of 4000.
Let $n=2000$, then
$$
n^{\prime}=\frac{2 a m-m^{2}}{n}=\frac{8000}{2000}=4 \text {. }
$$

Thus, $f(2,2000)=2$.
In summary, $\min _{(m, m \in 1} f=2$.
(B) Now, find the maximum value of $f$.

From (A), we know that when $(m, n) \in A$, $m$ and $n$ have the same parity and $n>m$, so we can let $n=m+2 u$. Here, $u$ is a positive integer, thus we have
$$
\begin{aligned}
f(m, n) & =\frac{2 a m-m^{2}-m n}{n}=\frac{2(a-u) m-2 m^{2}}{m+2 u} \\
& =\frac{2(a-u)(m+2 u)-2(a-u) 2 u}{m+2 u}-\frac{2(m+2 u)^{2}+8(m+2 u) u-8 u^{2}}{m+2 u} \\
& =(2 u+6 u)-2\left[m+2 u+\frac{2 u(a+u)}{m+2 u}\right] .
\end{aligned}
$$

From condition (3), we know
$$
(m+2 u)^{2}-m^{2}+2 m(m+2 u) \leqslant 4 u a \text {, i.e., } m^{2}+4 u m-2 a u+2 u^{2} \leqslant 0 \text {. }
$$

Solving this, we get
$$
m \leqslant-2 u+\sqrt{2 u(a+u)} \text {, i.e., } m+2 u \leqslant \sqrt{2 u(a+u)} \text {. }
$$

Since $f(m, m+2 u)$ is a positive even number,
$m+2 u$ must be a divisor of $2 u(a+u)$.
When $u=1$, $2(a-1)=4004=4 \times 7 \times 11 \times 13$.
From the symmetry of the expression in the square brackets in (5), we can assume
$m+2 \leqslant[\sqrt{4004}]=63$.
Thus, $m \in\{2,5,9,11,12,20,24,26,42,50\}$.
It is easy to see that when $m=50, n=52$, $(m, n) \in A$ and
$$
f(50,52)=4002+6-2\left[52+\frac{4004}{52}\right]=3750 \text {. }
$$

Since $f(m, \dot{m}+2 u)$ is strictly increasing with respect to $m$, we have $f(m, m+2) \leqslant 3750$.
We now prove that for any $(m, n) \in A$, $f(m, n) \leqslant 3750$.
We have already shown that when $n=m+2$, (7) holds. Since $m$ and $n$ have the same parity and $n>m$, we can assume $n \geqslant m+4$, thus
$$
f(m, n)=\frac{(2 a-m) m}{n}-m \leqslant \frac{(2 a-m) m}{m+4}-m \text {. }
$$

To prove (7) holds, we only need to show that for any
$1 \leqslant m<2 a=4002$, we have
$$
\frac{(2 a-m) m}{m+4}-m \leqslant 3750 \text {. }
$$

Rearranging, we get
$$
m^{2}-124 m+2 \times 3750 \geqslant 0 \text {. }
$$

Since
$$
\Delta=124^{2}-8 \times 3750=4\left(62^{2}-7500\right)<0,
$$

we know (8)' holds, thus (8) holds, and (7) holds.
In summary, $\max f(m, n)=3750$.