naive algorithm for closest pair