Solution. Let the number of girls be L, and the number of boys be F. The girls played a total of (2L) matches among themselves. Since exactly 1 point is awarded in each match, the girls scored a total of (2L) points against each other. According to the problem, the girls also scored a total of (2L) points in their matches against the boys. Similarly, the boys scored a total of (2F) points against the girls. Since there were LF girl-boy matches, we have
LF=(2L)+(2F)
which simplifies to 2LF=L(L−1)+F(F−1). From this equality, the total number of boys and girls participating in the competition is L+F=L2+F2−2LF=(L−F)2, which is indeed a perfect square.