Example 3 There is a type of sports competition with $M$ events, and athletes $A$, $B$, and $C$ participate. In each event, the first, second, and third places receive $p_{1}$, $p_{2}$, and $p_{3}$ points respectively, where $p_{1}$, $p_{2}$, $p_{3} \in \mathbf{Z}^{+}$, and $p_{1}>p_{2}>p_{3}$. In the end, $A$ scores 22 points, $B$ and $C$ both score 9 points. It is also known that $B$ came first in the 100-meter dash. Find the value of $M$.
(18th Canadian High School Mathematics Competition)
Solution: Consider the total score of three people, we have
$$
\begin{array}{l}
M\left(p_{1}+p_{2}+p_{3}\right)=22+9+9=40 . \\
\because p_{1}, p_{2}, p_{3} \in \mathbf{Z}^{+}, \text { and } p_{1}>p_{2}>p_{3}, \\
\therefore p_{1}+p_{2}+p_{3} \geqslant 3+2+1=6 .
\end{array}
$$

Thus, $6 M \leqslant 40, M \leqslant 6$.
Since $p_{1}>p_{2}>p_{3}$, and $B$ and $C$ have the same score, then $M \neq 1$. In addition, $M$ must divide 40, so $M$ can be $2, 4, 5$.
(1) If $M=2$, i.e., there is one more competition besides the 100-meter dash. Since $B$ is the first in the 100-meter dash and has a total score of only 9, it must be that $9 \geqslant p_{1}+p_{3}$. Therefore, $p_{1} \leqslant 8$. This way, $A$ cannot score 22 points in two competitions.
(2) If $M=4$, then for $B$'s score, we have $9 \geqslant p_{1} + 3 p_{3}$. So $p_{1} \leqslant 6$.

If $p_{1} \leqslant 5$, then $A$ can score at most 19 points in 4 competitions (since $B$ is the first in the 100-meter dash), but $A$ actually scored 22 points, so $p_{1}=6, p_{3}=1$.
$$
\begin{array}{l}
\because 4\left(p_{1}+p_{2}+p_{3}\right)=40, \\
\therefore p_{2}+p_{3}=4 . \\
\text { Thus, } p_{2}=3 .
\end{array}
$$

But $A$ can win at most 3 first places (since $B$ is already the first in the 100-meter dash) and 1 second place, scoring at most $3 \times 6 + 3 = 21$. This contradicts the given conditions.
(3) If $M=5$, from $5\left(p_{1}+p_{2}+p_{3}\right)=40$, we get $p_{1}+p_{2}+p_{3}=8$.

If $p_{3} \geqslant 2$, then $p_{1}+p_{2}+p_{3} \geqslant 4+3+2=9$, which is a contradiction.
So, $p_{3}=1$.
Also, $p_{1}$ must be at least 5, otherwise $A$ can score at most $4 \times 4 + 3 = 19$ points in 5 competitions, which is a contradiction.
So, $p_{1} \geqslant 5$.
If $p_{1} \geqslant 6$, then $p_{2}+p_{3} \leqslant 2$, which is also impossible. Thus, only $p_{1}=5$, and hence, $p_{2}=2, p_{3}=1$.
In conclusion, $M=5$.