Auto: : Yashchenko I. I. From Flower City to Sunny City, there is a highway 12 km long. On the second kilometer of this highway, there is a railway crossing, which is closed for three minutes and open for three minutes, and so on. On the fourth and sixth kilometers, there are traffic lights, which are red for two minutes and green for three minutes, and so on. Nезнayka sets out from Flower City to Sunny City at the moment when the crossing has just closed, and both traffic lights have just switched to red. What is the shortest time (in minutes) he can reach

Sunny City without breaking the rules, if his electric car travels along the highway at a constant speed (Nезнayka does not know how to brake or increase speed $) ?$

#
Nезнайка cannot pass the crossing located at the second kilometer of the highway until three minutes have passed, as well as on the seventh, eighth, and ninth minutes, on the thirteenth to fifteenth minutes, and so on. Graphically, this means that the graph of Nезнайка's movement (a straight line) cannot intersect the highlighted segments.

![](https://cdn.mathpix.com/cropped/2024_05_06_dc53e83c4670b2e19022g-06.jpg?height=463&width=903&top_left_y=352&top_left_x=589)

## Solution

We will plot time (in minutes) on the x-axis and distance from Flower City (in kilometers) on the y-axis. Since the speed of the electric car is constant, the graph of its movement is a straight line. Nезнайка cannot pass the crossing located at the second kilometer of the highway until three minutes have passed, as well as on the seventh, eighth, and ninth minutes, on the thirteenth to fifteenth minutes, and so on. Graphically, this means that the straight line cannot intersect the highlighted segments on the left graph. Similarly, we can mark the segments that cannot be crossed due to traffic lights (right graph). On the right graph, a straight line with the greatest slope that does not intersect any of the highlighted segments is drawn.
![](https://cdn.mathpix.com/cropped/2024_05_06_dc53e83c4670b2e19022g-06.jpg?height=976&width=982&top_left_y=1322&top_left_x=549)

## Answer

In 24 minutes.