4. On the side $B C$ of the rectangle $A B C D$ ( $\overline{A B}>\overline{B C}$ ), a point $K$ is chosen such that $\overline{B K}=4 \overline{K C}$, and on the side $C D$ a point $M$ is chosen such that $\overline{C M}=4 \overline{M D}$. Calculate the ratio $\overline{A B}: \overline{B C}$ when the angle $\angle K A M$ takes its maximum possible value.
Solution. Let points $K$ and $M$ be such that $\overline{B K}=4 \overline{K C}$ and $\overline{C M}=4 \overline{M D}$. Let $\measuredangle B A K=\alpha, \measuredangle M A D=\beta$ and $\measuredangle K A M$ attain its maximum possible value. Let the ratio we are looking for be $\overline{A B}: \overline{B C}=x(x>0)$. Clearly $\alpha+\beta$ attains its minimum value, i.e., $\operatorname{tg}(\alpha+\beta)$ is the smallest $\left(\alpha+\beta>0\right)$. We have $\operatorname{tg} \alpha=\frac{\overline{B K}}{\overline{A B}}=\frac{\frac{4}{5} \overline{B C}}{\overline{A B}}=\frac{4}{5} \frac{1}{x}$ and $\operatorname{tg} \beta=\frac{\overline{M D}}{\overline{A D}}=\frac{\frac{1}{5} \overline{A B}}{\overline{B C}}=\frac{1}{5} x$.

Now we have

$$
\operatorname{tg}(\alpha+\beta)=\frac{\operatorname{tg} \alpha+\operatorname{tg} \beta}{1-\operatorname{tg} \alpha \cdot \operatorname{tg} \beta}=\frac{\frac{4}{5 x}+\frac{x}{5}}{1-\frac{4}{5 x} \frac{x}{5}}=\frac{25}{21}\left(\frac{4}{5 x}+\frac{x}{5}\right)
$$

Here we can apply the inequality between the arithmetic and geometric means, from which we get

$$
\operatorname{tg}(\alpha+\beta) \geq \frac{25}{21} \cdot 2 \cdot \sqrt{\frac{4}{5 x} \cdot \frac{x}{5}}=\frac{50}{21} \cdot \frac{2}{5}=\frac{20}{21}
$$

The minimum value for $\operatorname{tg}(\alpha+\beta)$ is $\operatorname{tg}(\alpha+\beta)=\frac{20}{21}$, and it is achieved when $\frac{4}{5 x}=\frac{x}{5}$, i.e., for $x^{2}=4$. We get $x=2$, from which the desired ratio is $\overline{A B}: \overline{B C}=2: 1$ and in this case the angle $\measuredangle K A M$ is the largest.

## IV year