II. (Full marks 50 points) If the next student participates in the mathematics competition, among any $m(m \geqslant 3)$ students there is a unique common friend (if A is a friend of B, then B is also a friend of A). How many students are participating in the mathematics competition?
Based on the known conditions, each student has friends.
"If there are $k(\leqslant m)$ students who are friends with each other, then according to the known conditions, they have a common friend, and we get $k+1$ students who are friends with each other. By analogy, we conclude that there are $m+1$ students $A_{1}$, $A_{2}, \cdots, A_{m+1}$ who are friends with each other.

If $B$ is a person outside these $m+1$ students and $B$ is friends with at least two of $A_{1}, A_{2}, \cdots, A_{m+1}$, let $B$ be friends with $A_{1}$ and $A_{2}$, then $B, A_{3}, A_{1}, \cdots, A_{m+1}$, these $m$ students have two common friends $A_{1}$ and $A_{2}$, which contradicts the known conditions.

Therefore, a student $B$ outside $A_{1}, A_{2}, \cdots, A_{m+1}$ can be friends with at most one of $A_{1}$, $A_{2}, \cdots, A_{m+1}$. Suppose $B$ is not friends with $A_{2}, A_{3}, \cdots, A_{m+1}$, then the common friend $C$ of $B, A_{1}, A_{2}, \cdots, A_{m-1}$ is not $A_{m}$ or $A_{m+1}$, and of course not $A_{1}, A_{2}, \cdots, A_{m-1}$. Since $m \geqslant 3$, $C$ is friends with at least $m-1 \geqslant 2$ of $A_{1}, A_{2}, \cdots, A_{m+1}$. But it has been proven above that $C$ can be friends with at most one of $A_{1}, \cdots, A_{m+1}$, which is a contradiction.

Thus, the students participating in the math competition are only $A_{1}, A_{2}, \cdots, A_{m+1}$, these $m+1$ people (each person's friends are $m$ people)."