4. From Zlatoust to Miass, "GAZ", "MAZ", and "KamAZ" set off simultaneously. "KamAZ", having reached Miass, immediately turned back and met "MAZ" 18 km from Miass, and "GAZ" - 25 km from Miass. "MAZ", having reached Miass, also immediately turned back and met "GAZ" 8 km from Miass. What is the distance from Zlatoust to Miass
Answer: 60 km.

Solution. Let the distance between the cities be $x$ km, and the speeds of the trucks: "GAZ" $-g$ km/h, "MAZ" - $m$ km/h, "KAMAZ" - $k$ km/h. For each pair of vehicles, we equate their travel time until they meet.

We get $\frac{x+18}{k}=\frac{x-18}{m}, \frac{x+25}{k}=\frac{x-25}{g}$ and $\frac{x+8}{m}=\frac{x-8}{g}$. From this,

$\frac{x+18}{x-18} \cdot \frac{x-25}{x+25} \cdot \frac{x+8}{x-8}=\frac{k}{m} \cdot \frac{g}{k} \cdot \frac{m}{g}=1$.

Transform the obtained equation $x^{3}+x^{2}+(18 \cdot 8-18 \cdot 25-8 \cdot 25) x-18 \cdot 8 \cdot 25=x^{3}-x^{2}+(18 \cdot 8$ $-18 \cdot 25-8 \cdot 25) x+18 \cdot 8 \cdot 25 \square 2 x^{2}=2 \cdot 18 \cdot 8 \cdot 25$. Since $x>0$, then $x=60$.