Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Sort robots and factories by their positions.
After sorting, notice that each factory should repair some subsegment of robots.
Find the minimum total distance to repair first i robots with first j factories.