I. solution. Let $G$ and $V$ denote the time it takes to travel from $A$ to $B$ on foot and by train, respectively (in our case, $G=4$ hours, $V=0.4$ hours), and for any point $P$ on the $A B$ route, let the ratio $A P / A B$ be denoted by $x$. Then, it takes $x G$ hours to travel from $P$ to $A$ and $(1-x) G$ hours to travel from $P$ to $B$. The first choice is more advantageous if

$$
x G + V < (1-x) G
$$

Solving this inequality, we get $x < \frac{G-V}{2 G}$. If $x > \frac{G-V}{2 G}$, it is better to go directly to $B$, and if $x = \frac{G-V}{2 G}$, the two routes take the same amount of time. In our case, $\frac{G-V}{2 G} = \frac{9}{20}$, so the point $C$ that is $\frac{9}{20} A B = 9$ km from $A$ on the $A B$ segment separates the points where one route is better from the points where the other route is better.

II. solution. Suppose that when we walk to $A$ first, instead of boarding the train heading to $B$, we continue walking in the same direction. Since the train travels ten times faster than we do, by the time it reaches $B$, we will have only reached the point $D$, which is 2 km from $A$.

![](https://cdn.mathpix.com/cropped/2024_05_02_76499ff1b55186761fa0g-1.jpg?height=363&width=1304&top_left_y=781&top_left_x=405)

It is then advantageous for us to walk from $A$ to some point $P$ on the $A B$ segment if $P$ is closer to $D$ than to $B$, since $D$ was chosen such that it takes the same amount of time to walk from $P$ to $D$ as it does to walk from $P$ to $A$ and then take the train to $B$. Therefore, the points on the $B D$ segment that are closer to $A$ than to $C$ (the midpoint of $B D$) are those from which it is better to walk to $A$ first, and the points from $C$ to $B$ are those from which it is better to go directly to $B$. Since $D$ is 22 km from $B$ (20 + 2 km), $B C = 11$ km, and $A C = 9$ km.

Note. In the above solutions, we assumed that there is no need to wait for the train in $A$. If this were not the case, we would also need to study the schedule before making a decision.
From point $P$ between cities $A$ and $B$, we can reach $B$ in two ways: either walk the $P B$ route; or walk to $A$ and then take the train to $B$. From which points is the first method more advantageous, and from which points is the second method better, if we want to reach $B$ as quickly as possible? (The walking speed is $5 \mathrm{~km} / \mathrm{h}$, the train speed is $50 \mathrm{~km} / \mathrm{h}$, and the distance between $A$ and $B$ is $20 \mathrm{~km}$).