2. Vasya and Petya, participating in a school sports and entertainment game, need to cover a distance of 3 km as quickly as possible with only one pair of roller skates between them. They start simultaneously, one just running, the other running on roller skates. At any time, the one running on roller skates can leave them to their friend and continue running without them. Such an exchange can be made as many times as needed. Find the minimum time required to complete the distance (determined by the last one to arrive), if Vasya's speeds for regular running and running on roller skates are 4 km/h and 8 km/h, and Petya's speeds are 5 km/h and 10 km/h. Assume that no time is lost when switching between roller skates and regular running.
Solution: The entire distance is divided into several stages, where one of the schoolchildren runs without roller skates, and the other on roller skates. Let \( x \) be the sum of the lengths of the stages that Vasya runs on roller skates, \( t_{1} \) be the time he spends running the entire distance, and \( t_{2} \) be the time Petya spends running the entire distance. Then, \( t_{1} = \frac{x}{8} + \frac{3-x}{4} = \frac{6-x}{8} \) and \( t_{2} = \frac{3-x}{10} + \frac{x}{5} = \frac{3+x}{10} \). Note that the function \( t_{1}(x) \) is decreasing, while the function \( t_{2}(x) \) is increasing. We need to find the value of \( x \) for which \( t_{1} = t_{2} \), meaning the runners would finish at the same time. From \( \frac{6-x}{8} = \frac{3+x}{10} \Rightarrow x = 2, t_{1} = t_{2} = \frac{1}{2} \) hour. If \( x < 2 \), then \( t_{1}(x) > \frac{1}{2} > t_{2}(x) \); if \( x > 2 \), then \( t_{1}(x) < \frac{1}{2} < t_{2}(x) \). Therefore, the minimum time for the friends to complete the distance (based on the last one to arrive) is 0.5 hours. Answer: 0.5 hours.