In space, there are 1989 points, where no three points are collinear. Divide them into 30 groups with different numbers of points. For any three different groups, take one point from each to form a triangle. To maximize the total number of such triangles, how many points should each group have?
When dividing these 1989 points into 30 groups, the number of points in each group is denoted as $n_{1}n_{1}^{n} n_{2}$. When $n_{1}^{\prime}, n_{2}^{\prime}$ replace $n_{1} n_{2}$ while $n_{3}, \cdots, n_{3}$ remain unchanged, the value of $S$ increases, leading to a contradiction. $2^{\circ}$ The number of $i$ values such that $n_{1+1}-n_{1}=2$ is no more than 1. If there exist $1 \leqslant i_{0}<j_{0} \leqslant 29$ such that $n_{10+i_{1}}-n_{10}=2$ and $n_{10+i}-n_{10}=2$, then when using $n_{i_{0}}^{\prime}=n_{10+1}+1$ and keeping the rest unchanged, it is easy to see that the value of $S$ increases, which is impossible.
$3^{\circ}$ The number of $i$ values such that $n_{1+1}-n_{1}=2$ is exactly one. If for all $1 \leqslant i \leqslant 29$, $n_{1+1}-n_{1}=1$, then the number of points in the 30 groups can be denoted as $m-14, m-13, \cdots, m$, $m+1, \cdots, m+15$. In this case,
$$
\begin{array}{l}
\quad(m-14)+\cdots+m+(m+1)+\cdots+(m \\
+15)=30 m+15,
\end{array}
$$

which means the total number of points is a multiple of 5, which cannot be 1989.
$4^{\circ}$ Suppose the $i_{0}$-th difference $n_{10+1}-n_{10}=2$ and the other differences are all 1. Thus, we can set
$$
\begin{array}{l}
n_{j}=m+j-1, j=1, \cdots, i_{05} \\
n_{j}=m+j, \quad j=i_{0}+1, \cdots, 30 .
\end{array}
$$

Therefore, we have
$$
\begin{array}{l}
30 m+\sum_{j-1}^{30} i-i_{0}=1909, \\
30 m-i_{1}=1524,
\end{array}
$$

which gives $m=51, i_{0}=6$, meaning the number of points in the 30 groups are
$51,52, \cdots, 56,58,59, \cdots, 82$