#include <LEDA/plane_alg.h>
#include<LEDA/random.h>

main()
{
  int N = read_int("N = ");

  random_source S(1,1000000);

  list<point>     L0;
  list<rat_point> L1;


  for (int i=1; i <= N; i++)
  { int x,y;
    S >> x >> y;
    L0.append(point(x,y));
    L1.append(rat_point(x,y));
   }

  { point p1,p2;
    cout << "CLOSES_PAIR (double)   " << flush;
    float T = used_time();
    double d = CLOSEST_PAIR(L0,p1,p2);
    float t = used_time(T);
    cout << p1 << "   " << p2 << "   d= " << d << " (" << t << " sec)" << endl;
    newline;
   }

  { rat_point p1,p2;
    cout << "CLOSES_PAIR (rational) " << flush;
    float T = used_time();
    rational d = CLOSEST_PAIR(L1,p1,p2);
    float t = used_time(T);
    cout << p1 << " " << p2 << " d= " << d << " (" << t << " sec)" << endl;
    newline;
   }

  return 0;
}

