40. In a football tournament, each of the participating teams played against each other once. The teams scored $16,14,10,10,8,6,5,3$ points. How many teams participated in the tournament and how many points did the teams that played and finished in the top 4 positions lose? (A team gets 2 points for a win and 1 point for a draw.)
40. If the number of teams is $n$, then the total number of games is $\frac{n(n-1)}{2}$, and the total number of points scored by them is $(n-1) n$. In our example, we have $16+14+10+10+8+$ $+6+5+3=72$. Therefore, $(n-1) \cdot n=72$, or $(n-1) \cdot n=8 \cdot 9$, so $n=9$, i.e., there were 9 teams. The maximum number of points a team can score is: $2 \cdot 8=16$. This means the first team did not lose any points, the second team lost 2 points, the third and fourth teams lost 6 points each, and in total they lost 14 points $(2+6 \cdot 2=14)$. (One team did not score any points.)