- The ambulance is at city A at 30 km/h and crosses the first gutter after 5 minutes, so in 5 minutes the distance travelled is:
\[
\text{Distance} = \frac{30}{60} \times 5 = 2.5 \, \text{km}.
\]
- The remaining distance to cover after doubling the speed to 60 km/h is:
\[
\text{Distance left} = 20 \, \text{km} - 2.5 \, \text{km} = 17.5 \, \text{km}.
\]
- Time taken to cover the remaining distance at the doubled speed:
\[
\text{Time} = \frac{17.5}{60} = 0.2917 \, \text{hrs} = 17.5 \, \text{minutes}.
\]
- So the total time spent is \( 5 \, \text{minutes} + 17.5 \, \text{minutes} = 22.5 \, \text{minutes}. \)
- The time available is 40 minutes, and therefore the doctor gets \( 40 - 22.5 = 17.5 \) minutes for operation.