two farthest pair algorithms