2. On a line, several points were marked, including points $A$ and $B$. All possible segments with endpoints at the marked points are considered. Vasya calculated that point $A$ is inside 40 of these segments, and point $B$ is inside 42 segments. How many points were marked? (The endpoints of a segment are not considered its internal points.)
Answer: 14.

Solution. Let there be $a_{1}$ points on one side of point $A$ and $a_{2}$ points on the other side; $b_{1}$ points on one side of point $B$ and $b_{2}$ points on the other side. We can assume that $a_{1} \leqslant a_{2}, b_{1} \leqslant b_{2}$. Then $a_{1} a_{2}=40, b_{1} b_{2}=42$. At the same time, $a_{1}+a_{2}=b_{1}+b_{2}$. Let's consider all possible factorizations of the numbers 40 and 42:

$40=1 \cdot 40=2 \cdot 20=4 \cdot 10=5 \cdot 8 ; \quad 42=1 \cdot 42=2 \cdot 21=3 \cdot 14=6 \cdot 7$.

Only in one case do the sums of the divisors of these two numbers match: $5+8=6+7$. Therefore, $a_{1}=5, a_{2}=8, b_{1}=6, b_{2}=7$, and there are a total of 14 points.

Grading. 12 points for a correct solution. 2 points for a correct answer (without justification). If the correctness of the answer is shown but the uniqueness is not justified, 6 points.