There are N signals on the coordinate plane. Signal i sits at (xi,yi), and no two signals share a position.
You build a communication system out of some of the signals. Line the chosen signals up in increasing order of x coordinate and connect each neighboring pair in turn, so the chosen signals must all have different x coordinates. The length of the system is the sum of the Euclidean lengths of the connecting segments. A system built from a single signal has length 0.
A longer system carries the transmission further. Find the length of the longest communication system.