Six children are standing along the x-axis at points (0,0), (17,0), (40,0), (85,0), (173,0), (440,0). The children decide to meet at some point along the x-axis. What is the minimum total distance the children must walk in order to meet?

If they meet at (x,0) then the distance is

x+|x-17|+|x-40|+|x-85|+|x-173|+|x-440|

It is clear that for 40<=x<=85, the distance is constant. As x increases in that interval, the three leftmost terms all increase by 1, and the three rightmost terms all decrease by 1.

Outside that interval, there are more terms that increase than decrease, so the total distance increases.

So, the minimum distance occurs for 40<=x<=85, where it is 641