5. On the side $\overline{A B}$ of the rectangle $A B C D$, several points have been chosen, on the sides $\overline{B C}$ and $\overline{D A}$ four points each, and on the side $\overline{C D}$ five points. None of the chosen points is a vertex of the given rectangle. Using the chosen points as vertices, exactly 4040 quadrilaterals can be drawn such that at most one vertex lies on the segment $\overline{A B}$. How many points were chosen on the side $\overline{A B}$?
## Solution.

Let $n$ be the number of points chosen on the side $\overline{A B}$.

![](https://cdn.mathpix.com/cropped/2024_05_30_f21be537f7aa0e6e5185g-7.jpg?height=529&width=764&top_left_y=234&top_left_x=664)

Since at most one vertex of such a quadrilateral can belong to the segment $\overline{A B}$, we consider two cases:

a) no vertex of the quadrilateral belongs to the segment $\overline{A B}$.

b) exactly one vertex of the quadrilateral belongs to the segment $\overline{A B}$.

Note that on one side of the rectangle, there can be at most two vertices of the quadrilateral.

Two vertices on the side $\overline{B C}$ or on the side $\overline{D A}$ can be chosen in $(4 \cdot 3): 2=6$ ways, and two vertices on the side $\overline{C D}$ in $(5 \cdot 4): 2=10$ ways.

a) no vertex of the quadrilateral belongs to the segment $\overline{A B}$.

The vertices of the quadrilateral can be arranged as follows:

a1) two vertices on two sides of the rectangle

- two vertices on $\overline{B C}$ and $\overline{C D}$

there are $6 \cdot 10=60$ such quadrilaterals

- two vertices on $\overline{B C}$ and $\overline{D A}$

there are $6 \cdot 6=36$ such quadrilaterals

- two vertices on $\overline{C D}$ and $\overline{D A}$

there are $10 \cdot 6=60$ such quadrilaterals

a2) two vertices on one side and one vertex on each of the other sides

- two vertices on $\overline{B C}$, one vertex on $\overline{C D}$ and one vertex on $\overline{D A}$

there are $6 \cdot 5 \cdot 4=120$ such quadrilaterals

- two vertices on $\overline{C D}$, one vertex on $\overline{B C}$ and one vertex on $\overline{D A}$

there are $10 \cdot 4 \cdot 4=160$ such quadrilaterals

- two vertices on $\overline{D A}$, one vertex on $\overline{B C}$ and one vertex on $\overline{C D}$

there are $6 \cdot 4 \cdot 5=120$ such quadrilaterals

If no vertex of the quadrilateral belongs to the segment $\overline{A B}$, the quadrilateral can be drawn in

$$
60+36+60+120+160+120=556
$$

different ways.
b) exactly one vertex of the quadrilateral belongs to the segment $\overline{A B}$

The vertices of the quadrilateral can be arranged as follows:

b1) one vertex on each side

- one vertex on each side

there are $n \cdot 4 \cdot 5 \cdot 4=80 n$ such quadrilaterals

b2) two vertices on one side, one on the side $\overline{A B}$ and one on one of the remaining sides

- two vertices on the side $\overline{B C}$, one on the side $\overline{A B}$ and one on the side $\overline{C D}$ or $\overline{D A}$

there are $6 \cdot n \cdot(5+4)=54 n$ such quadrilaterals

- two vertices on the side $\overline{C D}$, one on the side $\overline{A B}$ and one on the side $\overline{B C}$ or $\overline{D A}$

there are $10 \cdot n \cdot(4+4)=80 n$ such quadrilaterals

- two vertices on the side $\overline{D A}$, one on the side $\overline{A B}$ and one on the side $\overline{B C}$ or $\overline{C D}$

there are $6 \cdot n \cdot(4+5)=54 n$ such quadrilaterals

If exactly one vertex of the quadrilateral belongs to the segment $\overline{A B}$, the quadrilateral can be drawn in

$$
54 n+80 n+54 n+80 n=268 n
$$

different ways.

The total number of quadrilaterals that can be drawn in the described way is 4040, so

$$
556+268 \cdot n=4040
$$

By rearranging, we get $268 \cdot n=3484$ and finally $n=13$.

13 points were chosen on the segment $\overline{A B}$.