Example 1 Suppose the sum of $m$ distinct positive even numbers and $n$ distinct positive odd numbers is 1987, find the maximum value of $3m + 4n$. (2nd CMO Problem)
Let the given $m$ positive even numbers be $a_{1}, a_{2}, \cdots, a_{m}$, and $n$ positive odd numbers be $b_{1}, b_{2}, \cdots, b_{n}$, then
$$\left(a_{1}+a_{2}+\cdots+a_{m}\right)+\left(b_{1}+b_{2}+\cdots+b_{n}\right)=1987$$

Notice that the extremal function is a function of $m$ and $n$, and in the constraint, $m$ and $n$ only appear as subscripts of the variables. Therefore, the constraints on $a_{1}, a_{2}, \cdots, a_{m}$ and $b_{1}, b_{2}, \cdots, b_{n}$ in (1) should be converted into constraints on $m$ and $n$.

Since $a_{1}, a_{2}, \cdots, a_{m}$ and $b_{1}, b_{2}, \cdots, b_{n}$ are distinct positive even and odd numbers, respectively, we have
$$\begin{aligned}
1987 & =\left(a_{1}+a_{2}+\cdots+a_{m}\right)+\left(b_{1}+b_{2}+\cdots+b_{n}\right) \\
& \geqslant(2+4+6+\cdots+2 m)+(1+3+\cdots+2 n-1) \\
& =m^{2}+n^{2}+m
\end{aligned}$$

Our goal is to express $3 m+4 n \leqslant A$ (a constant) in a form that resembles the Cauchy inequality structure, so we should complete the square on the right side of (2) to convert it into a "sum of squares". Thus,
$$\begin{array}{l}
1987+\frac{1}{4} \geqslant\left(m+\frac{1}{2}\right)^{2}+n^{2}, \\
\left(1987+\frac{1}{4}\right)\left(3^{2}+4^{2}\right) \geqslant\left(3^{2}+4^{2}\right)\left[\left(m+\frac{1}{2}\right)^{2}+n^{2}\right] \\
\geqslant\left(3\left(m+\frac{1}{2}\right)+4 n\right)^{2},
\end{array}$$

Therefore, $3 m+\frac{3}{2}+4 n \leqslant 5 \sqrt{1987+\frac{1}{4}}$, so $3 m+4 n \leqslant\left[5 \sqrt{1987+\frac{1}{4}}-\frac{3}{2}\right]=221$.

Next, we construct a set of numbers to make the inequality an equality. First, find $(m, n)$ such that $3 m+4 n=221$. This indeterminate equation has multiple solutions, but to satisfy (2), $m$ and $n$ should be as close as possible to ensure that the corresponding even and odd numbers are as small as possible. Through trial, we find that when $m=27$ and $n=35$, $3 m+4 n=221$, and $m^{2}+n^{2}+m=1981<1987$, satisfying (2).

Take the smallest 27 positive even numbers as $a_{1}=2, a_{2}=4, \cdots, a_{27}=54$, and the smallest 35 positive odd numbers as $b_{1}=1, b_{2}=3, \cdots, b_{34}=67, b_{35}=69$, then
$$\left(a_{1}+a_{2}+\cdots+a_{27}\right)+\left(b_{1}+b_{2}+\cdots+b_{35}\right)=1987-6,$$

Modify $b_{35}$ to: $69+6=75$, then
$$\left(a_{1}+a_{2}+\cdots+a_{27}\right)+\left(b_{1}+b_{2}+\cdots+b_{35}\right)=1987$$

In conclusion, the maximum value of $3 m+4 n$ is 221.