Task 5. Find all triples $(a, b, c)$ of positive integers with $a+b+c=10$ such that there exist $a$ red, $b$ blue, and $c$ green points (all distinct) in the plane with the following properties:

- for each red point and each blue point, we consider the distance between these two points; the sum of all these distances is 37;
- for each green point and each red point, we consider the distance between these two points; the sum of all these distances is 30;
- for each blue point and each green point, we consider the distance between these two points; the sum of all these distances is 1;
Solution. We form triangles consisting of a blue, a red, and a green point. These triangles may also be degenerate. In each of these triangles, the (non-strict) triangle inequality holds: the distance between the blue and the red point is at most equal to the sum of the distances between the blue and the green and between the red and the green points. We count all these triangle inequalities (one for each triangle that can be formed with a blue, a red, and a green point). We count each distance between a red and a blue point $c$ times (since with a fixed blue and red point, you can still choose $c$ points as the third, green vertex), each distance between a green and a red point $b$ times, and each distance between a blue and a green point $a$ times. We thus get

$$
37 c \leq 30 b + a \text{.}
$$

Since $a + b + c = 10$, it follows that $37 c \leq 30 b + (10 - b - c) = 10 + 29 b - c$, so $38 c \leq 10 + 29 b$. That is,

$$
\frac{38 c - 10}{29} \leq b
$$

We can also apply the triangle inequality differently: the distance between the green and the red point is at most equal to the sum of the distances between the red and the blue and between the blue and the green points. If we add up all these inequalities, we get

$$
30 b \leq 37 c + a
$$

This gives $30 b \leq 37 c + (10 - b - c) = 10 + 36 c - b$, so $31 b \leq 10 + 36 c$, or

$$
b \leq \frac{10 + 36 c}{31}
$$

Combining (9) and (10) gives

$$
\frac{38 c - 10}{29} \leq \frac{10 + 36 c}{31}
$$

so $31(38 c - 10) \leq 29(10 + 36 c)$. Simplifying gives $134 c \leq 600$, so $c \leq 4$. We now go through the possibilities for $c$ one by one.

Suppose $c = 1$. Then (10) gives $b \leq \frac{46}{31} < 2$, which implies $b = 1$. We get $(a, b, c) = (8, 1, 1)$.

Suppose $c = 2$. Then (9) and (10) give $2 < \frac{66}{29} \leq b \leq \frac{82}{31} < 3$, so there is no integer $b$ that satisfies this.

Suppose $c = 3$. Then (9) and (10) give $3 < \frac{104}{29} \leq b \leq \frac{118}{31} < 4$, so there is no integer $b$ that satisfies this.

Suppose $c = 4$. Then (9) and (10) give $4 < \frac{142}{29} \leq b \leq \frac{154}{31} < 5$, so there is no integer $b$ that satisfies this.

The only triplet that could possibly satisfy the conditions is thus $(8, 1, 1)$. We now show that we can indeed choose 8 red points, 1 blue point, and 1 green point in the plane such that all conditions are met. We use a standard coordinate system. Choose the blue point at $(0, 0)$ and the green point at $(1, 0)$. Choose red points at $(i, 0)$ with $2 \leq i \leq 8$. Choose one more red point such that it forms an isosceles triangle with the green and blue points, with two sides of length 2. The sum of the distances between red points and the blue point is now $2 + 2 + 3 + \cdots + 8 = 37$. The sum of the distances between red points and the green point is $2 + 1 + 2 + \cdots + 7 = 30$. The distance between the blue point and the green point is 1.

We conclude that the only solution is $(8, 1, 1)$.