## Task B-4.5.

Three parallel lines $a, b$, and $c$ are given. On line $a$, points $A, B$, and $C$ are marked; on line $b$, points $D, E, F$, and $G$; and on line $c$, points $H, I, J, K$, and $L$. What is the maximum number of triangles determined by the points in the set $\{A, B, C, D, E, F, G, H, I, J, K, L\}$?
## First solution.

We distinguish four cases:

First case. On each of the lines $a, b$, and $c$, there is one vertex of the triangle. Since we are looking for the maximum possible number of triangles, we assume that the chosen triplets of points are not collinear. The vertex on line $a$ can be chosen in three ways, the vertex on line $b$ in four ways, and the vertex on line $c$ in five ways. In total, there are $3 \cdot 4 \cdot 5 = 60$ such triangles.

Second case. Two vertices of the triangle are on line $a$, and the third vertex is on one of the other two lines. There are $\binom{3}{2} \cdot (4 + 5) = 27$ such triangles.

Third case. Two vertices are on line $b$, and the third vertex is on one of the other two lines. There are $\binom{4}{2} \cdot (3 + 5) = 48$ such triangles.

Fourth case. Two vertices are on line $c$, and the third vertex is on one of the other two lines. There are $\binom{5}{2} \cdot (3 + 4) = 70$ such triangles.

Finally, there are at most $60 + 27 + 48 + 70 = 205$ such triangles.