3A. A car traveled from city $A$ to city $B$ at a speed of $60 \mathrm{~km} / \mathrm{h}$ on uphill sections, $72 \mathrm{~km} / \mathrm{h}$ on flat sections, and $90 \mathrm{~km} / \mathrm{h}$ on downhill sections, and it took the entire journey 5 hours. To return, traveling at the same speeds, the car needed 4 hours.

What is the distance from $A$ to $B$?
Solution. Let $g \mathrm{~km}$ of the road from $A$ to $B$ consist of uphill sections, $r \mathrm{~km}$ consist of flat sections, and $d \mathrm{~km}$ consist of downhill sections. Then, according to the conditions of the problem, we get:

$$
\frac{g}{60}+\frac{r}{72}+\frac{d}{90}=5
$$

When traveling in reverse, the sections that were uphill become downhill and vice versa, so we have:

$$
\frac{g}{90}+\frac{r}{72}+\frac{d}{60}=4
$$

By summing (1) and (2), we get $\frac{g+r+d}{36}=9$, or $g+r+d=324$.

Therefore, the distance from $A$ to $B$ is 324 km.