Working closest pair better algo