Diameter of the Point Set — Solution & Editorial
The farthest pair are both hull vertices. Build the convex hull, then rotating calipers finds the diameter in O(hull size).
Complexity: O(N log N)
Watch out: Squared distances reach ~8×1012 — 64-bit; and checking only hull points is essential (interior points are never farthest).