Closest pair of points problem. Each point p i is defined by its coordinates (x i, y i) .