⚡Charger Placement Operation!
Place 3 chargers among 6 stops (3,6,12,17,25,30km), maximizing the distance between the two closest chargers!
Loading...
Place 3 chargers among 6 stops (3,6,12,17,25,30km), maximizing the distance between the two closest chargers!
As EVs become more common, charging queues at highway rest stops keep getting longer. Along a quiet highway, rest stops are lined up in a straight line, each given as a distance (km) from the starting point (0km). The budget is tight, so you can install exactly C chargers. If the chargers cluster together, the far stretches of the highway become inconvenient to charge at. So you want to pick rest stops so that the "distance between the two closest chargers" is **as large as possible**. Find the maximum possible value of that minimum distance between adjacent chargers.
6 3 3 6 12 17 25 30
13
Placing chargers at 3km, 17km, 30km gives gaps of 14km and 13km → minimum 13km. A wider 14km only allows 3km and 17km (2 chargers), which is not enough, so the answer is 13.