Implement the algorithm for the closest pair problem in your favorite language.
INPUT: Given n points in a plane.
INPUT: Given n points in a plane.
OUTPUT: the pair with the least Euclidean distance.
#include <iostream>
#include <cmath>
#include <cstdio>
#include <algorithm>
using namespace std;
const int MAXN = 100010;
struct Node {
double x;
double y;
}node[MAXN], pairOne, pairTwo;//record the position of closest pair
bool CmpByX (Node a, Node b);
bool CmpByY (Node a, Node b);
double GetClosestPairs (int left, int right);
double GetDistance (Node a, Node b);
int main () {
int n;
while (~scanf("%d", &n) && n != 0) {