Problem 5. (Option 2).

How to build a highway? (an old problem) From a riverside city A, goods need to be transported to point B, located $a$ kilometers downstream and $d$ kilometers from the riverbank. How should the highway be built from B to the river so that the transportation of goods from A to B is as cost-effective as possible, if the freight rate per ton-kilometer by river is half that of the highway?
Solution: Let the distance $AD$ be denoted by $x$ and the length of the highway $DB$ by $y$: by assumption, the length of $AC$ is $a$ and the length of $BC$ is $d$.

Since transportation along the highway is twice as expensive as along the river, the sum $x + 2y$ should be the smallest according to the problem's requirement. Let this smallest value be denoted by $m$.

We have the equation $x + 2y = m$. But $x = a - DC$, and $DC = \sqrt{y^2 - d^2}$; our equation becomes $a - \sqrt{y^2 - d^2} + 2y = m \quad \Rightarrow \quad 3y^2 - 4(m-a)y + (m-a)^2 + d^2 = 0$. $y = \frac{2}{3}(m-a) \pm \frac{\sqrt{(m-a)^2 - 3d^2}}{3}$

For $y$ to be real, $(m-a)^2$ must be at least $3d^2$.

The smallest value of $(m-a)^2$ is $3d^2$, and then $m - a = d\sqrt{3}$, $y = \frac{2(m-a) + 0}{3} = \frac{2d\sqrt{3}}{3} ; \sin \angle BDC = \frac{d}{y} = d : \frac{2d\sqrt{3}}{3} = \frac{\sqrt{3}}{2}$.

The angle whose sine is $\sqrt{3} / 2$ is $60^\circ$. Therefore, the highway should be built at an angle of $60^\circ$ to the river, regardless of the distance $AC$.

The solution only makes sense under certain conditions. If the point is located such that the highway, built at an angle of $60^\circ$ to the river, passes on the other side of city $A$, then the solution is invalid. In such a case, the point $B$ should be directly connected to city $A$ by a highway, without using the river for transportation at all.