Example 8 Color each vertex of a quadrilateral pyramid with one color, and make the endpoints of the same edge have different colors. If only 5 colors are available, how many different coloring methods are there?
Solution 1: According to the problem, the vertices $S, A, B$ of the quadrilateral pyramid $S-ABCD$ are colored with different colors, and there are $P_{5}^{3}=60$ ways to color them.

When $S, A, B$ are already colored, let's assume their colors are 1, 2, 3 respectively. If $C$ is colored 2, then $D$ can be colored 3, 4, or 5, which gives 3 ways; if $C$ is colored 4, then $D$ can be colored 3 or 5, which gives 2 ways; if $C$ is colored 5, then $D$ can be colored 3 or 4, which also gives 2 ways. Therefore, when $S, A, B$ are already colored, $C$ and $D$ have 7 ways to be colored. Thus, the total number of coloring methods is $60 \times 7 = 420$.

Solution 2: The coloring that satisfies the problem's conditions must use at least three colors.
(1) If exactly three colors are used, we can first choose one color from the five to color vertex $S$, then choose two colors from the remaining four to color points $A, B, C, D$. At this point, $A$ and $C$, $B$ and $D$ must be the same color, so there are $C_{5}^{1} \cdot C_{4}^{2} \cdot C_{2}^{1} = 60$ ways.
(2) If exactly four colors are used, we can first choose one color from the five to color vertex $S$, then choose two colors from the remaining four to color $A$ and $B$. Since the colors of $A$ and $B$ can be swapped, there are $P_{4}^{2}$ ways to color them; then choose one color from the remaining two to color $D$ or $C$, and the other one of $D$ and $C$ will be colored the same as its opposite vertex, so there are $C_{5}^{1} \cdot P_{4}^{2} \cdot C_{2}^{1} \cdot C_{2}^{1} = 240$ ways.
(3) If exactly five colors are used, it is easy to know that there are $P_{5}^{5} = 120$ ways.
In summary, the total number of coloring methods that satisfy the problem's conditions is $60 + 240 + 120 = 420$.

The number of boys in each group is $x_{1}, x_{2}, \cdots, x_{8}$, clearly $x_{1} + x_{2} + \cdots + x_{8} = 25$. At this point, the circular arrangement of 8 groups with girls as the heads is considered to meet the problem's conditions, and we have
$$
\sum_{i=1}^{8} (x_{i} - 2) = \sum_{i=1}^{8} x_{i} - 16 = 9.
$$

Let $X_{i} = x_{i} - 2 (i = 1, 2, \cdots, 8)$, then $\sum_{i=1}^{8} X_{i} = 9$, where $X_{i} \geq 0, i = 1, 2, \cdots, 8$. This indeterminate equation has $C_{9+8-1}^{9} = C_{16}^{9}$ non-negative integer solutions, meaning there are $C_{16}^{9}$ ways to distribute 25 boys into 8 groups. The number of circular arrangements of 8 groups is $P_{7}^{7}$, and the number of arrangements of 25 boys is $P_{25}^{25}$. Therefore, the total number of arrangement methods is $C_{16}^{9} \cdot P_{7}^{7} \cdot P_{25}^{25} = \frac{25!16!}{9!}$.