semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main() {
	int x[10];
	int y[10];
	int z[10];
	int a,b,c,n,i,r,j,p=0,k;
	double jl[45];
	double d;
	scanf("%d",&n);
	k=n*(n-1)/2;
	for(i=0;i<n;i++){
		scanf("%d",&x[i]);
		scanf("%d",&y[i]);
		scanf("%d",&z[i]);
	}
	for(i=0;i<n;i++){
		for(j=i+1;j<n;j++){
			a=x[i]-x[j];
			b=y[i]-y[j];
			c=z[i]-z[j];
			jl[p]=sqrt(1.0*a*a+b*b+c*c);
			p++;
		}
	}
	double e;
	for(i=1;i<=k;i++){
		for(j=0;j<k-i;j++){
			if(jl[j]>jl[j+1]){
				e=jl[j+1];
				jl[j+1]=jl[j];
				jl[j]=e;
			}
		}
	}
	double bcjl[45];
	bcjl[0]=jl[0];
	int w;
	w=1;
	for(i=1;i<k;i++){
		if(jl[i]==jl[i-1]){
			continue;
		}else{
			bcjl[w]=jl[i];
			w++;
		}
	}
	for(r=w-1;r>=0;r--){
		for(i=0;i<n;i++){
			for(j=i+1;j<n;j++){
				a=x[i]-x[j];
				b=y[i]-y[j];
				c=z[i]-z[j];
				d=sqrt(1.0*a*a+b*b+c*c);
				if(d==bcjl[r]){
					printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[i],y[i],z[i],x[j],y[j],z[j],d);
				}
			}
		}
	}
	return 0;
}
void main()
{
	float max,s[11][11],z[11][3];
	int i,j,n,x,y,k;
	scanf("%d",&n);
	memset(s,0,sizeof(s));
	memset(z,0,sizeof(z));
	for (i=1;i<=n;i++)
	{
		scanf("%f%f%f",&z[i][0],&z[i][1],&z[i][2]);
		for (j=1;j<i;j++)
		{
			s[j][i]=sqrt((z[i][0]-z[j][0])*(z[i][0]-z[j][0])+(z[i][1]-z[j][1])*(z[i][1]-z[j][1])+(z[i][2]-z[j][2])*(z[i][2]-z[j][2]));
		}
	}
	for (i=1;i<=n*(n-1)/2;i++)
	{
		max=s[1][2];
		x=1;y=2;
		for (j=1;j<n;j++)
			for (k=j+1;k<=n;k++)
			{
				if (s[j][k]>max)
				{
					x=j;y=k;
					max=s[j][k];
				//printf("%.2f\n",max);
				}
			}
        printf("(%.0f,%.0f,%.0f)-(%.0f,%.0f,%.0f)=%.2f\n",z[x][0],z[x][1],z[x][2],z[y][0],z[y][1],z[y][2],s[x][y]);
		s[x][y]=0;
	}
	

}
struct point{
	double x;
	double y;
	double z;
};
struct range{
    double a[3];
    double b[3];
    double x;
};
int main(){
struct point points[10];
struct range ranges[200];
int n;
cin>>n;
for(int i=0;i<n;i++)
cin>>points[i].x>>points[i].y>>points[i].z;
int k=0;
for(int i=0;i<n;i++)
for(int j=i+1;j<n;j++){
ranges[k].x=sqrt(pow((points[i].x-points[j].x),2)+pow((points[i].y-points[j].y),2)+pow((points[i].z-points[j].z),2));
ranges[k].a[0]=points[i].x;ranges[k].a[1]=points[i].y;ranges[k].a[2]=points[i].z;
ranges[k].b[0]=points[j].x;ranges[k].b[1]=points[j].y;ranges[k].b[2]=points[j].z;
k++;}
struct range temp;
for(int i=0;i<=k;i++)
for(int j=0;j<=k-i;j++)
if(ranges[j].x<ranges[j+1].x){
temp=ranges[j];
ranges[j]=ranges[j+1];
ranges[j+1]=temp;
}
for(int i=0;i<k;i++)
cout<<fixed<<setprecision(0)<<'('<<ranges[i].a[0]<<','<<ranges[i].a[1]<<','<<ranges[i].a[2]<<')'<<'-'<<'('<<ranges[i].b[0]<<','<<ranges[i].b[1]<<','<<ranges[i].b[2]<<')'<<'='<<fixed<<setprecision(2)<<ranges[i].x<<endl;




}
struct distance
{
	int point1;
	int point2;
	double dis;
} a[200], t;
int main()
{
	int x[20] = {0}, y[20] = {0}, z[20] = {0}, n, i, j, k = 1;
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> x[i] >> y[i] >> z[i];
	}
	for (i = 1; i <= n; i++)
	{
		for (j = i + 1; j <= n; j++, k++)
		{
			a[k].dis = sqrt(pow(x[i] - x[j], 2.0) + pow(y[i] - y[j], 2.0) + pow(z[i] - z[j], 2.0));
			a[k].point1 = i;
			a[k].point2 = j;
		}
	}
	for (k = 1; k <= n * (n - 1) / 2; k++)
	{
		for (i = 1; i <= n * (n - 1) / 2 + 1 - k; i++)
		{
			if (a[i].dis < a[i + 1].dis)
			{
				t = a[i];
				a[i] = a[i + 1];
				a[i + 1] = t;
			}
		}
	}
	for (i = 1; i <= n * (n - 1) / 2; i++)
	{
		cout << "(" << x[a[i].point1] << "," << y[a[i].point1] << "," << z[a[i].point1] << ")-(" << x[a[i].point2] << "," << y[a[i].point2] << "," << z[a[i].point2] << ")=" << fixed << setprecision(2) << a[i].dis << endl;
	}
	return 0;
}
struct point
{
	double x;
	double y;
	double z;
};
struct dianju
{
	double d;
	struct point p1;
	struct point p2;
};
void main()
{

	double julijisuan(struct point p1,struct point p2);
	int n,i,j,k;
	struct point p[m];
	struct dianju D[m*(m-1)/2];
	struct dianju a;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%lf%lf%lf",&p[i].x,&p[i].y,&p[i].z);
	}
	for(i=0,k=0;i<n-1;i++)
	{
	
		for(j=i;j<n-1;j++,k++)
		{
			D[k].p1=p[i];
			D[k].p2=p[j+1];
			D[k].d=julijisuan(D[k].p1,D[k].p2);
		}
	}
	for(i=0;i<n*(n-1)/2;i++)
	{
		for(j=0;j<n*(n-1)/2-1;j++)
		{
			if(D[j].d<D[j+1].d)
			{
				a=D[j];
				D[j]=D[j+1];
				D[j+1]=a;
			}
		}
	}
	for(i=0;i<n*(n-1)/2;i++)
	{
		printf("(%.0lf,%.0lf,%.0lf)-(%.0lf,%.0lf,%.0lf)=%.2lf\n",D[i].p1.x,D[i].p1.y,D[i].p1.z,D[i].p2.x,D[i].p2.y,D[i].p2.z,D[i].d);
	}

	



}


double julijisuan(struct point p1,struct point p2)
{
	return(sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y)+(p1.z-p2.z)*(p1.z-p2.z)));
}
int main(){
int m,n,i,h=1,l=0,k,j,x[11],y[11],z[11],N;
	double s[50],p,d[50],t;
	scanf("%d",&n);
	N=(((n-1)*n)/2);     /*???N?*/
	for(i=0;i<n;i++){
		scanf("%d %d %d",&x[i],&y[i],&z[i]);
	}
	for(i=0;i<n;i++){
		for(k=i+1;k<n;k++){ /*???????????????*/		s[l]=sqrt((x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k])+(z[i]-z[k])*(z[i]-z[k]));/*????sl*/
			l++;/*?????s[l]*/
			}
	}
	for(l=0;l<N;l++){/*??????sl????????*/
	   m=l;
      for(j=l+1;j<N;j++){
 		if (s[m]<s[j]){
	p=s[j];
 			s[j]=s[m];
 			s[m]=p;
 		}
 	 }
	}
	d[0]=s[0],j=1;/*????????j-1?????d[0]??*/
	for(l=1;l<N;l++){/*?????????sl???????????*/
		if(d[j-1]!=s[l]){
			d[j]=s[l];
			j++;
			h++;
			}
		}
    for (j=0;j<h;j++){/*??????d[j]??*/
       for(i=0;i<n;i++){
		  for(k=i+1;k<n;k++){  	t=sqrt((x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k])+(z[i]-z[k])*(z[i]-z[k]));
			if(d[j]==t){/*??d[j]???x[i],x[k]??????*/		 printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[i],y[i],z[i],x[k],y[k],z[k],d[j]);           
			}
		   }
		   }
    }
    return 0;   
}
//***********************************
//** ???Dec 11, 2013 - ???? **
//** ?????? 1300012719       **
//** ???2013.12.14              **
//***********************************
int main()
{
	int i, j, k = 0, n;                    //k???n????????
	struct p                               //???p????????
	{
		int x;
		int y;
		int z;
	} p[10];
	struct ptp                             //???ptp?????????????????,?????45,?????????????
	{
		int x1;
		int y1;
		int z1;
		int x2;
		int y2;
		int z2;
		double dis;
	} ptp[46];
	cin >> n;                              //?????????????
	for (i = 0; i < n; i++)
		cin >> p[i].x >> p[i].y >> p[i].z;
	for (i = 0; i < n - 1; i++)            //?????????,?????????????
	for (j = i + 1; j < n; j++)
	{
		ptp[k].x1 = p[i].x;
		ptp[k].x2 = p[j].x;
		ptp[k].y1 = p[i].y;
		ptp[k].y2 = p[j].y;
		ptp[k].z1 = p[i].z;
		ptp[k].z2 = p[j].z;
		ptp[k].dis = sqrt((ptp[k].x1-ptp[k].x2) * (ptp[k].x1-ptp[k].x2) + 
						  (ptp[k].y1-ptp[k].y2) * (ptp[k].y1-ptp[k].y2) + 
						  (ptp[k].z1-ptp[k].z2) * (ptp[k].z1-ptp[k].z2));
		k++;
	}
	for (i = 0; i < k - 1; i++)            //??????ptp[45],?????????ptp???????
	for (j = 0; j < k - 1 - i; j++ )
	{
		if (ptp[j].dis < ptp[j + 1].dis)
		{
			ptp[45] = ptp[j];
			ptp[j] = ptp[j + 1];
			ptp[j + 1] = ptp[45];
		}
	}
	for (i = 0; i < k; i++)                //???????????
		cout << "(" << ptp[i].x1 << "," << ptp[i].y1 << "," << ptp[i].z1 << ")-(" 
					<< ptp[i].x2 << "," << ptp[i].y2 << "," << ptp[i].z2 << ")=" 
					<< fixed << setprecision(2) << ptp[i].dis << endl;
	return 0;
}
typedef struct
{
	int x,y,z;
} Point;
typedef struct
{
	double len;
	int pt1,pt2;
} Distance;
double CalDis(Point pt1,Point pt2)
{
	return sqrt((double)(pt1.x-pt2.x)*(pt1.x-pt2.x)+(pt1.y-pt2.y)*(pt1.y-pt2.y)+(pt1.z-pt2.z)*(pt1.z-pt2.z));
}
int cmp( const void *a ,const void *b)
{
	if((*(Distance *)a).len != (*(Distance *)b).len)
		return (*(Distance *)a).len > (*(Distance *)b).len ? -1 : 1;
		//return ((Distance *)b)->len - ((Distance *)a)->len;
	//return (*(Distance *)a).pt1 > (*(Distance *)b).pt1 ? 1 : -1;
	if(((Distance *)a)->pt1 != ((Distance *)b)->pt1)
		return ((Distance *)a)->pt1 - ((Distance *)b)->pt1;
	return ((Distance *)a)->pt2 - ((Distance *)b)->pt2;
}
/*int cmp( const void *a ,const void *b)
{
	if((*(Distance *)b).len != (*(Distance *)a).len)
		return (*(Distance *)b).len > (*(Distance *)a).len ? 1 : -1;
	else
		return (*(Distance *)a).pt1 > (*(Distance *)b).pt1 ? 1 : -1;
}*/
Distance ds[N];
int main()
{
	int n,count=0,i,j;
	Point pts[10];	
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d %d %d",&pts[i].x,&pts[i].y,&pts[i].z);
	for(i=0;i<n;i++)
		for(j=i+1;j<n;j++)
		{
			ds[count].len=CalDis(pts[i],pts[j]);
			ds[count].pt1=i;
			ds[count++].pt2=j;
		}
	qsort(ds,count,sizeof(ds[0]),cmp);
	for(i=0;i<count;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",pts[ds[i].pt1].x,pts[ds[i].pt1].y,
		pts[ds[i].pt1].z,pts[ds[i].pt2].x,pts[ds[i].pt2].y,pts[ds[i].pt2].z,ds[i].len);	
	return 0;
}
int main()
{
	int n,i,j,count=1;
	double	x[20],y[20],z[20],t;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>x[i]>>y[i]>>z[i];//?xyz??
	}
	struct position//?????????????
	{
		double x;double a;
		double y;double b;
		double z;double c;
		double d;
	}p[100];
	for(i=1;i<=n;i++)
	{
		for(j=i+1;j<=n;j++)
		{   
			p[count].x=x[i];p[count].a=x[j];
		    p[count].y=y[i];p[count].b=y[j];
		    p[count].z=z[i];p[count].c=z[j];
			p[count].d=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]));//???
			count++;
		}
	}
	for(i=count-1;i>0;i--)
	{
		for(j=1;j<i;j++)
		{
			if(p[j].d<p[j+1].d)
			{
				swap(p[j].x,p[j+1].x);
				swap(p[j].y,p[j+1].y);
                swap(p[j].z,p[j+1].z);
                swap(p[j].a,p[j+1].a);
                swap(p[j].b,p[j+1].b);
                swap(p[j].c,p[j+1].c);
                swap(p[j].d,p[j+1].d);//??????????
			}
		}
	}
	for(i=1;i<=count-1;i++)
	{
		cout<<'('<<(int)p[i].x<<','<<(int)p[i].y<<','<<(int)p[i].z<<')'<<'-'<<'('<<(int)p[i].a<<','<<(int)p[i].b<<','<<(int)p[i].c<<')'<<'='<<fixed<<setprecision(2)<<p[i].d<<endl;
	}
return 0;
}
float dis(int a[3],int b[3])
{
float d=0;
for (int i=0;i<3;i++)
   d+=(a[i]-b[i])*(a[i]-b[i]);
d=pow(d,0.5);
return d;
}

int main()
{
int n,x=0,y;
scanf("%d",&n);
int a[n][3];
y=n*(n-1)/2;
float b[y][3],m[3];
for (int i=0;i<n;i++)
   for (int j=0;j<3;j++)
      scanf("%d",&a[i][j]);
for (int i=0;i<n-1;i++)
   for (int j=i+1;j<n;j++)
      {
      b[x][0]=i;
      b[x][1]=j;
      b[x][2]=dis(a[i],a[j]);
      x++;
      }
for (int j=y-2;j>=0;j--)
   for (int i=0;i<=j;i++)
      if (b[i][2]<b[i+1][2])
      for (int k=0;k<3;k++)
         {
         m[k]=b[i][k];
         b[i][k]=b[i+1][k];
         b[i+1][k]=m[k];
         }
for (int i=0;i<y;i++)
   printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",a[(int)b[i][0]][0],a[(int)b[i][0]][1],a[(int)b[i][0]][2],a[(int)b[i][1]][0],a[(int)b[i][1]][1],a[(int)b[i][1]][2],b[i][2]);
}
int main(){
    int n,i,k,s,m;
    int zb[10][3];
    double d[45][7],e;
    scanf("%d",&n);
    for(i=0;i<n;i++){
                                for(s=0;s<3;s++){
                                scanf("%d",&(zb[i][s]));
                                }
                                }
                                s=0;
    for(i=0;i<=n-2;i++){
                        for(k=1;i+k<=n-1;k++){
                                              m=(zb[i][0]-zb[i+k][0])*(zb[i][0]-zb[i+k][0])+(zb[i][1]-zb[i+k][1])*(zb[i][1]-zb[i+k][1])+(zb[i][2]-zb[i+k][2])*(zb[i][2]-zb[i+k][2]);
                                              d[s][0]=sqrt(m);
                                              d[s][1]=zb[i][0];
                                              d[s][2]=zb[i][1];
                                              d[s][3]=zb[i][2];
                                              d[s][4]=zb[i+k][0];
                                              d[s][5]=zb[i+k][1];
                                              d[s][6]=zb[i+k][2];
                                              s++;
                                              }
                                              }
    m=s;
     for(k=1;m-k>0;k++){
                        for(i=0;i<m-k;i++){
                                          if(d[i][0]<d[i+1][0]){
                                                                for(s=0;s<7;s++){
                                                            e=d[i][s];
                                                            d[i][s]=d[i+1][s];
                                                            d[i+1][s]=e;
                                                            }
                                                            }
                                          }
                        }
     for(i=0;i<m;i++){
                      printf("(%.0f,%.0f,%.0f)-(%.0f,%.0f,%.0f)=%.2f\n",d[i][1],d[i][2],d[i][3],d[i][4],d[i][5],d[i][6],d[i][0]);
                      }
               
                      return 0;
                      }
void main()
{
	int i,j,k=0,p,n,c[100][3],d[100][6],temp;
	double t[100],temp2;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		for(j=0;j<3;j++)
			scanf("%d",*(c+i)+j);
	}
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
		{
			d[k][0]=c[i][0];
			d[k][1]=c[i][1];
			d[k][2]=c[i][2];
			d[k][3]=c[j][0];
			d[k][4]=c[j][1];
			d[k][5]=c[j][2];
			t[k]=(c[i][0]-c[j][0])*(c[i][0]-c[j][0]);
			t[k]+=(c[i][1]-c[j][1])*(c[i][1]-c[j][1]);
			t[k]+=(c[i][2]-c[j][2])*(c[i][2]-c[j][2]);
			t[k]=sqrt(t[k]);
			k++;
		}
	}
	for(i=1;i<k;i++)
	{
		for(j=0;j<k-i;j++)
		{
			if(t[j]<t[j+1])
			{
				for(p=0;p<6;p++)
				{
					temp=d[j][p];
					d[j][p]=d[j+1][p];
					d[j+1][p]=temp;
				}
				temp2=t[j];
				t[j]=t[j+1];
				t[j+1]=temp2;
			}
		}
	}
	for(i=0;i<k;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",d[i][0],d[i][1],d[i][2],d[i][3],d[i][4],d[i][5],t[i]);
}
int t[2000];

double id(int a,int b,int c)
{
    return sqrt(a*a+b*b+c*c);

}
int main()
{
 int i,j,n,m,s=0,x[20],y[20],z[20],q[200],w[200];
 double d[200];
 scanf("%d",&m);
 for(i=0;i<m;i++)

       { scanf("%d%d%d",&x[i],&y[i],&z[i]);

       }
        n=m*(m-1)/2;
for(i=0;i<m-1;i++)

for(j=i+1;j<m;j++)
{
d[s]=id(x[i]-x[j],y[i]-y[j],z[i]-z[j]);
q[s]=i;
w[s]=j;
s++;
}




         //for(i=0;i<=n+1;i++)
        //{for(j=0;j<=n+1;j++)printf("%d ",a[i][j]);printf("\n");}
        for(i=1;i<=n;i++)
        for(j=0;j<n-i;j++)
        if(d[j]<d[j+1])
        {
            swap(q[j],q[j+1]);
            swap(w[j],w[j+1]);
            swap(d[j],d[j+1]);

        }



        for(j=0;j<n;j++)
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[q[j]],y[q[j]],z[q[j]],x[w[j]],y[w[j]],z[w[j]],d[j]);
        return 0;


}
/*
 * 1.cpp
 *
 *  Created on: 2010-12-29
 *      Author: 10033
 */


int main(){//????
	int n,i,j;
	int a[10],b[10],c[10];//??
	struct zuobiao{//???????????
		int x[2];
		int y[2];
		int z[2];
		float length;
	}number[100],t;
	cin>>n;
	for(i=0;i<n;i++)//??
		cin>>a[i]>>b[i]>>c[i];
	for(i=0;i<n;i++)//????zuobiao???
		for(j=i+1;j<n;j++){
			number[(((n-1)+(n-i))*i/2)+j-i].x[0]=a[i];
			number[(((n-1)+(n-i))*i/2)+j-i].x[1]=a[j];
			number[(((n-1)+(n-i))*i/2)+j-i].y[0]=b[i];
			number[(((n-1)+(n-i))*i/2)+j-i].y[1]=b[j];
			number[(((n-1)+(n-i))*i/2)+j-i].z[0]=c[i];
			number[(((n-1)+(n-i))*i/2)+j-i].z[1]=c[j];
			number[(((n-1)+(n-i))*i/2)+j-i].length=sqrt((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j])+(c[i]-c[j])*(c[i]-c[j]));
		}
	for(i=1;i<=(n-1)*n/2;i++)//????
		for(j=1;j<=(n-1)*n/2-i;j++)
			if(number[j].length<number[j+1].length){
				t=number[j];
				number[j]=number[j+1];
				number[j+1]=t;
			}
	for(i=1;i<=(n-1)*n/2;i++)//??
		cout<<"("<<number[i].x[0]<<","<<number[i].y[0]<<","<<number[i].z[0]<<")-("
		<<number[i].x[1]<<","<<number[i].y[1]<<","<<number[i].z[1]<<")="<<fixed<<setprecision(2)<<number[i].length<<endl;
	return 0;
}//????
int main()
{
  
    int i,j,k,l,m,n,num,tempi;
    int x[10],y[10],z[10];
    float d[100];
    float tempd;
    int dp1[100],dp2[100];
    //scan the numbers
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d%d%d",&x[i],&y[i],&z[i]);
    }
  
    num=-1;
    for(i=0;i<n-1;i++)
        for(j=i+1;j<n;j++)
        {
            num++;
            d[num]=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]));
            dp1[num]=i;
            dp2[num]=j;
        }
  
   
    num++;
    for(i=0;i<num-1;i++)
        for(j=i+1;j<num;j++)
        {
            if(d[j]>d[i])
            {
                //swap d
                tempd=d[j];
                d[j]=d[i];
                d[i]=tempd;
                //swap dp1
                tempi=dp1[i];
                dp1[i]=dp1[j];
                dp1[j]=tempi;
                //swap dp2
                tempi=dp2[i];
                dp2[i]=dp2[j];
                dp2[j]=tempi;
            }
            if(d[j]==d[i]&&(dp1[j]<dp1[i]||dp1[j]==dp1[i]&&dp2[j]<dp2[i]))
            {
              
                tempd=d[j];
                d[j]=d[i];
                d[i]=tempd;
               
                tempi=dp1[i];
                dp1[i]=dp1[j];
                dp1[j]=tempi;
          
                tempi=dp2[i];
                dp2[i]=dp2[j];
                dp2[j]=tempi;
            }
        }
   
    for(i=0;i<num;i++)
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[dp1[i]],y[dp1[i]],z[dp1[i]],x[dp2[i]],y[dp2[i]],z[dp2[i]],d[i]);

}
int main()
{
	int n,i,j,k,p=0,x[11][3],y[100][3],z[100][3];
	double d1[45]={0},d[45];
	cin>>n;
	for(i=0;i<n;i++)
		for(j=0;j<3;j++)
	{
		cin>>x[i][j];
	}
	for(i=0;i<n-1;i++)
		{   
			for(j=i+1;j<n;j++)
			{
				for(k=0;k<3;k++)
				{    
					d1[p]=d1[p]+((double)x[i][k]-(double)x[j][k])*((double)x[i][k]-(double)x[j][k]);
					y[p][k]=x[i][k];
				    z[p][k]=x[j][k];
				}
				
				d[p]=sqrt(d1[p]);
				p++;
	}
	}
	for(i=0;i<p-1;i++)
		{for(j=p-2;j>=i;j--)
	{if(d[j]<d[j+1]) {
		swap(d[j],d[j+1]);
		swap(y[j][0],y[j+1][0]);
		swap(y[j][1],y[j+1][1]);
		swap(y[j][2],y[j+1][2]);
		swap(z[j][0],z[j+1][0]);
		swap(z[j][1],z[j+1][1]);
		swap(z[j][2],z[j+1][2]);
	}}}
	for(i=0;i<p;i++)
	{cout<<"("<<y[i][0]<<","<<y[i][1]<<","<<y[i][2]<<")"<<"-"<<"("<<z[i][0]<<","<<z[i][1]<<","<<z[i][2]<<")"<<"="<<fixed<<setprecision(2)<<d[i]<<endl;}
	return 0;
}
/*
 * shuzu.2.3.cpp
 *
 *  Created on: 2012-11-19
 *      Author: wangrunhui
 */


int main()
{
	int n,a[10][3],i,j,k ,ai[100],ak[100],l = 0,tempi,tempk;//a?????i,j,k,l???????ai?ak??????????
	double d[100],tempd;//d????
	cin >> n;
	for ( i = 0; i < n; i ++)//?a??
	{
		for ( j = 0; j < 3; j ++)
			cin >> a[i][j];
	}
	for ( i = 0; i < n; i ++)//????????????????????
	{
		for ( k = i + 1; k < n; k ++ )//???i+1?????????????
		{
			d[l] = sqrt( (a[i][0] - a[k][0]) * (a[i][0] - a[k][0])
					+ (a[i][1] - a[k][1]) * (a[i][1] - a[k][1])
					+ (a[i][2] - a[k][2]) * (a[i][2] - a[k][2]) );
			ai[l] = i;//??????
			ak[l] = k;
			l ++;//?????????
		}
	}
	for ( i = 0 ; i < l - 1; i ++)//????????????????????????????
	{
		for ( j = 0; j < l - i - 1; j ++)
		{
			if ( d[j] < d[j + 1])
			{
				tempd = d[j];
				d[j] = d[j + 1];
				d[j + 1] = tempd;
				tempi = ai[j];
				ai[j] = ai[j + 1];
				ai[j + 1] = tempi;
				tempk = ak[j];
				ak[j] = ak[j + 1];
				ak[j + 1] = tempk;
			}
		}
	}
	for ( j = 0; j < l ; j ++)//??????
	{
		i = ai[j];
		k = ak[j];
		cout << '(' << a[i][0] << ','<< a[i][1] << ',' << a[i][2] << ")-(";
		cout << a[k][0] << ',' << a[k][1] << ',' << a[k][2]<< ")=";
		cout<< fixed << setprecision(2) <<d[j]<<endl;//???????
	}
}
void main(){
	int n,a[30],b[45][6],btemp[45][6],i,j,k,T;
	double d,c[45],temp;

	scanf("%d",&n);
	
	T=n*(n-1)/2;

	for(i=0;i<3*n;i++){
		scanf("%d",&a[i]);
	}
	
	j=0;
	for(i=0;i<n-1;i++){
		for(k=1;k<=(n-1)-i;k++){
			d=sqrt((a[3*i]-a[3*i+3*k])*(a[3*i]-a[3*i+3*k])+(a[3*i+1]-a[3*i+3*k+1])*(a[3*i+1]-a[3*i+3*k+1])+(a[3*i+2]-a[3*i+3*k+2])*(a[3*i+2]-a[3*i+3*k+2]));
			b[j][0]=a[3*i];
			b[j][3]=a[3*i+3*k];
			b[j][1]=a[3*i+1];
			b[j][4]=a[3*i+3*k+1];
			b[j][2]=a[3*i+2];
			b[j][5]=a[3*i+3*k+2];
			c[j]=d;
			j++;
		}
	}
	
	for(i=0;i<T;i++){
		for(j=0;j<T-i;j++){
			if(c[j]<c[j+1]){

				temp=c[j];
				c[j]=c[j+1];
				c[j+1]=temp;

				btemp[j][0]=b[j][0];
				btemp[j][1]=b[j][1];
				btemp[j][2]=b[j][2];
				btemp[j][3]=b[j][3];
				btemp[j][4]=b[j][4];
				btemp[j][5]=b[j][5];

				b[j][0]=b[j+1][0];
				b[j][1]=b[j+1][1];
				b[j][2]=b[j+1][2];
				b[j][3]=b[j+1][3];
				b[j][4]=b[j+1][4];
				b[j][5]=b[j+1][5];
				
				b[j+1][0]=btemp[j][0];
				b[j+1][1]=btemp[j][1];
				b[j+1][2]=btemp[j][2];
				b[j+1][3]=btemp[j][3];
				b[j+1][4]=btemp[j][4];
				b[j+1][5]=btemp[j][5];

			}
		}
	}

	for(j=0;j<T;j++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",b[j][0],b[j][1],b[j][2],b[j][3],b[j][4],b[j][5],c[j]);
	}
}
int main()
{
    int n,i,j,r,t;
	float x[10],y[10],z[10],d[10][10]={-1},max;
	cin>>n;
	for (i=0;i<n;i++)
		cin>>x[i]>>y[i]>>z[i];
	for (i=0;i<n;i++)
		for (j=i+1;j<n;j++)
			 d[i][j]=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]));
	for (int k=0;k<(n*(n-1)/2);k++)
	{
	    max=0;
		for (i=0;i<n;i++)
		    for (j=i+1;j<n;j++)
				if (d[i][j]>max)
					{
						max=d[i][j];
						r=i;
						t=j;
				    }
        d[r][t]=-1;
		cout<<'('<<x[r]<<','<<y[r]<<','<<z[r]<<")-("<<x[t]<<','<<y[t]<<','<<z[t]<<")=";
		printf("%.2f\n",max);
	}
return 0;
}
int main(){
	int n,a[11],b[11],c[11],i,j,s,q,maxi=0,maxj=1;
	double d[90][90];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&a[i],&b[i],&c[i]);
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			s=(a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j])+(c[i]-c[j])*(c[i]-c[j]);
			d[i][j]=sqrt(1.0*s);
		}
	}
	for(q=0;q<n*(n-1)/2;q++){
		for(i=0;i<n-1;i++){
			for(j=i+1;j<n;j++){
				if(d[i][j]>d[maxi][maxj]){
					maxi=i;
					maxj=j;
				}
			}
		}
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[maxi],b[maxi],c[maxi],a[maxj],b[maxj],c[maxj],d[maxi][maxj]);
		d[maxi][maxj]=0;
	}
	return 0;
}
void main()
{
    int n,i,m,j,k=0;
    double d,b[100][7]={0},a[10][3]={0},temp[7];
    char c[10][3];
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
    	for(j=0;j<3;j++)
    	{
    		scanf("%lf",&a[i][j]);
    		scanf("%c",&c[i][j]);
    	}
    }
    for(i=0;i<n;i++)
    {
    	for(j=i+1;j<n;j++)
    	{
    		d=sqrt((a[i][0]-a[j][0])*(a[i][0]-a[j][0])+(a[i][1]-a[j][1])*(a[i][1]-a[j][1])+(a[i][2]-a[j][2])*(a[i][2]-a[j][2]));
    	    b[k][0]=a[i][0];
    	    b[k][1]=a[i][1];
    	    b[k][2]=a[i][2];
    	    b[k][3]=a[j][0];
    	    b[k][4]=a[j][1];
    	    b[k][5]=a[j][2];
    	    b[k][6]=d;
    	    k++;
    	}
    }
    for(i=0;i<n*(n-1)/2;i++)
    {
    	for(j=i+1;j<n*(n-1)/2;j++)
    	{
    		if(b[j][6]>b[i][6])
    		{
    			for(k=0;k<7;k++)
    			{
    			temp[k]=b[j][k];
    			}
    			for(m=j;m>i;m--)
    			{
    				for(k=0;k<7;k++)
    			    {
    			    	b[m][k]=b[m-1][k];
    			    }
    			}
    			for(k=0;k<7;k++)
    			{
    			b[i][k]=temp[k];
    			}
    			
    			
    		}
    	}
    }
    for(i=0;i<n*(n-1)/2;i++)
    printf("(%.0lf,%.0lf,%.0lf)-(%.0lf,%.0lf,%.0lf)=%.2lf\n",b[i][0],b[i][1],b[i][2],b[i][3],b[i][4],b[i][5],b[i][6]);
    			
    			
    
    		
    		
}
int main()
{
	int n,i,j,k=0;
	int x[10],y[10],z[10];
	struct Distance
	{
		int a,b;
		double d;
	}dis[50],t;
	scanf("%d",&n);
	for(i=0;i<=n-1;i++)
		scanf("%d %d %d",&x[i],&y[i],&z[i]);
	for(i=0;i<=n-1;i++)
		for(j=1+i;j<=n-1;j++)
		{
			if(i==j)
				continue;
			dis[k].d=sqrt((double)((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j])));
			dis[k].a=i;
			dis[k].b=j;
			k++;
		}
	for(i=0;i<=k-2;i++)
		for(j=0;j<=k-2-i;j++)
			if(dis[j].d<dis[j+1].d)
			{
				t=dis[j];
				dis[j]=dis[j+1];
				dis[j+1]=t;
			}
	for(i=0;i<=k-1;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[dis[i].a],y[dis[i].a],z[dis[i].a],x[dis[i].b],y[dis[i].b],z[dis[i].b],dis[i].d);
	return 0;
}
int main()
{
	int n,a[10],b[10],c[10],i,j,k,m,h=0;
	double d[ROW][COL],e[100],w,f;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		if(i==0){
			scanf("%d %d %d",&a[i],&b[i],&c[i]);
		}else{
			scanf(" %d %d %d",&a[i],&b[i],&c[i]);
		}
	}
	for(i=0;i<n;i++){
		for(j=i+1;j<n;j++){
			w=1.0*((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j])+(c[i]-c[j])*(c[i]-c[j]));
				d[i][j]=pow(w,1.0/2);
				e[h]=d[i][j];
				h++;
		}
	}
	m=n*(n-1)/2;
	for(k=1;k<=m;k++){
		for(i=0;i<m-k;i++){
			if(e[i]>e[i+1]){
				f=e[i+1];
				e[i+1]=e[i];
				e[i]=f;
			}
		}
	}
	e[m]=0;
	for(k=m-1;k>=0;k--){
		if(!(e[k]==e[k+1])){
		for(i=0;i<n;i++){
			for(j=i+1;j<n;j++){
				if(d[i][j]==e[k]){
				printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i],b[i],c[i],a[j],b[j],c[j],e[k]);
				}
			}
		}
	}
	}
	return 0;
}