3.17 A pedestrian walking from home to the railway station, having walked 3 km in the first hour, calculated that he would be 40 minutes late for the train departure if he continued at the same speed. Therefore, he walked the remaining distance at a speed of 4 km/h and arrived at the station 15 minutes before the train's departure. What is the distance from home to the station, and at what constant speed for the entire journey would the pedestrian have arrived at the station exactly on time?
3.17 Let's construct the following table:

| The pedestrian would arrive at the station | Distance, km | Speed, km/h | Time, h |
| :--- | :---: | :---: | :---: |
| On time | $x$ | $v$ | $\frac{x}{v}$ |
| Late | $x-3$ | 3 | $\frac{x-3}{3}$ |
| Early | $x-3$ | 4 | $\frac{x-3}{4}$ |

By equating the time intervals recorded in the first and second, and the first and third rows, we get the system of equations

$\frac{x}{v}=1+\frac{x-3}{3}-\frac{2}{3}, \frac{x}{v}=1+\frac{x-3}{4}+\frac{1}{4}$,

or

$\frac{x-2}{3}=\frac{x+2}{4}$,

from which $x=14$. Therefore, $x=14 \mathrm{~km}, v=3.5 \mathrm{~km} / \mathrm{h}$.

Answer: $14 \mathrm{~km} ; 3.5$ km/h.