joj2487

 2487: Central Avenue Road


Result
TIME Limit
MEMORY Limit
Run Times
AC Times
JUDGE
3s
65536K
743
169
Standard
There are a lot of trees in the park of Jilin University. We want to open up a road in this forest in a straight line from one tree to another. In order to view more scenery, the difference of both sides of the road is minimum (zero or one). If other tree is just on the road, it is not counted on both sides. Of course, we have a lot of ways to build this road. The best way is that the distance of two reference trees is shortest.

Input


The first line of each case is the number of trees N (2 <= N <=100). The next N lines have two integers that is the x and y coordinates of the i-th tree. The input file is terminated by N=0.

Output


For each case, output the distance of the two reference trees that the road obeys the above rules and the distance is shortest. Keep three digits after decimal point.

Sample Input

4
0 0
3 4
10 0
0 10
0

Sample Output

5.000

Problem Source: provided by skywind
#include #include int main() {     double  a[102][3];     int  n;     double temp;     while(scanf("%d",&n),n)     {         temp=0xffffffff;         for(int i=1;i<=n;i++)         {             scanf("%lf%lf",&a[i][1],&a[i][2]);         }         for(int i=1;ia[i][1])right++;                             else if(a[t][1]k*a[t][1]+)right++;elseif(a[t][2]

좋은 웹페이지 즐겨찾기