There are N signals on the coordinate plane. Signal i sits at (xi,yi), and no two signals share a position.
A communication system is built by choosing some of the signals and joining them with segments in order of increasing x coordinate. The chosen signals must have pairwise different x coordinates. The length of the system is the sum of the Euclidean distances between consecutive signals, and a system built from a single signal has length 0.
Build the communication system of greatest length so that a signal reaches as far as possible, then report that length.