semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{   
	double f(int a[],int b[]); 
	int n,a[10][3],count=0,i,j,k,d[45][2],num=0;
	int g(int i,int j,int k,int d[][2],double b[],int n);
	double t,b[45];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		for(j=0;j<3;j++)
			scanf("%d",&a[i][j]);
		
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
		{b[count]=f(a[i],a[j]);
		count++;}
		for(i=0;i<n*(n-1)/2-1;i++)
			for(j=0;j<n*(n-1)/2-1-i;j++)
				if(b[j]<b[j+1])
	{t=b[j];b[j]=b[j+1];b[j+1]=t;}
     for(i=0;i<n-1;i++)
	 { for(j=i+1;j<n;j++)
	  if(f(a[i],a[j])==b[0])
     {printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i][0],a[i][1],a[i][2],a[j][0],a[j][1],a[j][2],b[0]);d[0][0]=i;d[0][1]=j;num++;break;}
	 if(num==1) {num=0;break;}
	 }
     for(k=1;k<n*(n-1)/2;k++)
     for(i=0;i<n-1;i++)
	 { for(j=i+1;j<n;j++)
			if(f(a[i],a[j])==b[k])
			{	if(b[k]!=b[k-1]) 
				{ printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i][0],a[i][1],a[i][2],a[j][0],a[j][1],a[j][2],b[k]);d[k][0]=i;d[k][1]=j;
			num++; break;}
			else if(g(i,j,k,d,b,n)) 
			{ printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i][0],a[i][1],a[i][2],a[j][0],a[j][1],a[j][2],b[k]);d[k][0]=i;d[k][1]=j;
			num++; break;}
			}
			if(num==1) {num=0; break;}
	 }
	return 0;
}
  double f(int a[],int b[])
  {double d;
  d=sqrt((a[0]-b[0])*(a[0]-b[0])+(a[1]-b[1])*(a[1]-b[1])+(a[2]-b[2])*(a[2]-b[2]));
	  return d;
  }


	int g(int i,int j,int k,int d[][2],double  b[],int n)
	{int x,num1=0;
	 for(x=0;x<=k;x++)
		 if(b[x]==b[k]) num1++;
		 for(x=1;x<num1;x++)
			 if(d[k-x][0]==i&&d[k-x][1]==j)
			 {return 0;break;}
			 if(x>=num1) return 1;
	}
typedef struct point 
{
	int x,y,z;
}Point;

double Distance(Point p1, Point p2)
{
	double dist=0;
	dist = sqrtf((p1.x-p2.x)*(p1.x-p2.x) + (p1.y-p2.y)*(p1.y-p2.y) + (p1.z-p2.z)*(p1.z-p2.z)+0.0 );
	return dist;
}
int main(int argc, char* argv[])
{
	int n, i, j, k=0, numtotal, maxpj=0, maxpi=0;
	double ** ppdDist,  dMaxDist=0.0;//*p1Dist,
	Point * pcPoint;


	scanf("%d",&n);
	numtotal = n*(n-1)/2;
	//p1Dist = (double *)calloc(numtotal, sizeof(double));
	ppdDist = (double**)calloc(n, sizeof(double*));
	for (i=0; i<n; i++)
	{
		ppdDist[i] = (double *)calloc(n, sizeof(double));
	}
	pcPoint = (Point *) calloc(n, sizeof(Point));

	for (j=0; j<n; j++)
	{
		for (i=0; i<n; i++)
		{
			ppdDist[j][i] = 0.0;
		}
	}
	//////////////////////////////////////////////////////////////////////////
	for (i=0; i<n; i++)
	{
		scanf("%d%d%d", &(pcPoint[i].x), &(pcPoint[i].y), &(pcPoint[i].z));
	}

	for (j=0; j<n; j++)
	{
		for (i=j+1; i<n; i++)
		{
			ppdDist[j][i] =Distance(pcPoint[j], pcPoint[i]);
		}
	}

	for (k=0; k<numtotal; k++)
	{
		for (j=0; j<n; j++)
		{
			for (i=j+1; i<n; i++)
			{
				if (ppdDist[j][i]>dMaxDist) ///????????????????0
				{
					maxpi = i;
					maxpj = j;
					dMaxDist = ppdDist[j][i];
				}
			}
		}
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n", pcPoint[maxpj].x, pcPoint[maxpj].y, pcPoint[maxpj].z, 
			pcPoint[maxpi].x, pcPoint[maxpi].y, pcPoint[maxpi].z, dMaxDist); 

		ppdDist[maxpj][maxpi] =0.0;// is out
		maxpi =0; maxpj =0; dMaxDist =0.0;

	}

	//////////////////////////////////////////////////////////////////////////
	for (i=0; i<n; i++)
	{
		free(ppdDist[i]);
	}
	free(ppdDist);
	free(pcPoint);
	return 0;
}
int main(){
	int a[10][4],m[45][4],n[45][4],i=0,j=0,k=0,p,q,w;
	double b[10][10],c[45];
	scanf("%d",&w);
	for(i=0;i<w;i++){
		scanf("%d%d%d",&a[i][1],&a[i][2],&a[i][3]);
	}
	for(i=0;i<w;i++){
		for(j=i+1;j<w;j++){
			b[i][j]=(double)sqrt((a[i][1]-a[j][1])*(a[i][1]-a[j][1])+(a[i][2]-a[j][2])*(a[i][2]-a[j][2])+(a[i][3]-a[j][3])*(a[i][3]-a[j][3]));
		}
	}
	for(k=0;k<w*(w-1)/2;k++){
		c[k]=b[0][1];
		p=0;
		q=1;
		for(i=0;i<w-1;i++){
			for(j=i+1;j<w;j++){
				if(c[k]<b[i][j]){
					c[k]=b[i][j];
					p=i;
					q=j;
				}
			}	
		}
		b[p][q]=-1;
		m[k][1]=a[p][1];m[k][2]=a[p][2];m[k][3]=a[p][3];
		n[k][1]=a[q][1];n[k][2]=a[q][2];n[k][3]=a[q][3];
	}
	for(k=0;k<w*(w-1)/2;k++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",m[k][1],m[k][2],m[k][3],n[k][1],n[k][2],n[k][3],c[k]);
	}
return 0;
}
int main()
{
	struct info1
	{
		int a[3];
	}
	point[N];
	struct info2
	{
		int f[3],l[3];
		double result;
	}
	dist[N*(N-1)/2];
	int n,i,j,k=0,p;
	double tmpdist;
	int tmppoint;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d %d %d",&point[i].a[0],&point[i].a[1],&point[i].a[2]);
	}
	for (i=0;i<n;i++)
	{
		for (j=i+1;j<n;j++)
		{
			dist[k].result=sqrt((double)(point[i].a[0]-point[j].a[0])*(point[i].a[0]-point[j].a[0])+(point[i].a[1]-point[j].a[1])*(point[i].a[1]-point[j].a[1])+(point[i].a[2]-point[j].a[2])*(point[i].a[2]-point[j].a[2]));
			for (p=0;p<3;p++)
			{
				dist[k].f[p]=point[i].a[p];
				dist[k].l[p]=point[j].a[p];
			}
			k++;
		}
	}
	for (j=1;j<k;j++)
	{
		for (i=0;i<k-j;i++)
		{
			if (dist[i].result<dist[i+1].result)
			{
				tmpdist=dist[i].result;
				dist[i].result=dist[i+1].result;
				dist[i+1].result=tmpdist;
				for (p=0;p<3;p++)
				{
					tmppoint=dist[i].f[p];
					dist[i].f[p]=dist[i+1].f[p];
					dist[i+1].f[p]=tmppoint;
					tmppoint=dist[i].l[p];
					dist[i].l[p]=dist[i+1].l[p];
					dist[i+1].l[p]=tmppoint;
				}
			}
		}
	}
	for (i=0;i<k;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",dist[i].f[0],dist[i].f[1],dist[i].f[2],dist[i].l[0],dist[i].l[1],dist[i].l[2],dist[i].result);
	}
	return 0;
}
//????
int main()
{
    int n,a[10],b[10],c[10],s=0,x[100],y[100],ht;
	double d[100],max;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i]>>b[i]>>c[i];//?????
	}
	for(int i=0;i<n;i++)
	{
	   for(int j=i+1;j<n;j++)
	   {
		   d[s]=sqrt((a[i]*1.0-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j])+(c[i]-c[j])*(c[i]-c[j]));
		   x[s]=i;y[s]=j;
		   s++;
		   
	   }}//???????
	   for(int i=0;i<n*(n-1)/2;i++)
	   {
		   for(s=0;s<n*(n-1)/2-1;s++)
		 {
		   if(d[s]<d[s+1])
		   {
		      max=d[s];d[s]=d[s+1];d[s+1]=max;
			  ht=x[s];x[s]=x[s+1];x[s+1]=ht;
			  ht=y[s];y[s]=y[s+1];y[s+1]=ht;
		   }//????
		 }
	   }
	   for(s=0;s<=n*(n-1)/2 -1;s++)
	   {
		
            cout<<'('<<a[x[s]]<<','<<b[x[s]]<<','<<c[x[s]]<<")-("<<a[y[s]]<<','<<b[y[s]]<<','<<c[y[s]]<<')'<<'='<<setprecision(2)<<fixed<<d[s]<<endl;//??
	   }

	return 0;
	
}
int main()
{
	int n,b,c,i,j,k,e,g;
	scanf("%d",&n);
	int sa[11],sb[11],sc[11];
	for(i=0;i<n;i++)
	{
        scanf("%d%d%d",&sa[i],&sb[i],&sc[i]);
	}
    
	int s[51],y[51],z[51];
	double l[51],f;
	i=0;
    for(j=0;j<n-1;j++)
	{
		   for(k=j+1;k<n;k++)
		   {
		      s[i]=(sa[j]-sa[k])*(sa[j]-sa[k])+(sb[j]-sb[k])*(sb[j]-sb[k])+(sc[j]-sc[k])*(sc[j]-sc[k]);
			  l[i]=sqrt(s[i]);
			  y[i]=j;
			  z[i]=k;//??????

			  i++;
		   }
	}
	
	for(i=1;i<=(n*(n-1)/2);i++)
	{
		for(j=0;j<(n*(n-1)/2-i);j++)
		{
			if(l[j]<l[j+1])
			{
				f=l[j];
				l[j]=l[j+1];
				l[j+1]=f;//????
			    e=y[j];
                y[j]=y[j+1];
                y[j+1]=e;
                g=z[j];
                z[j]=z[j+1];
                z[j+1]=g;//???????
			}	
		}
	}
	for(i=0;i<(n*(n-1)/2);i++)
	{
		
		b=y[i];
		c=z[i];
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",sa[b],sb[b],sc[b],sa[c],sb[c],sc[c],l[i]);
	}
	return 0;
}
int main(){
	int n,a[100][100],i,j,k,p,l,m=0,x,c[100][100],d[100][100],e2,e3,o,w=0;
	double b[100],e1;
	 scanf("%d",&n);
	for(i=0;i<n;i++){
		for(j=0;j<3;j++){
		   scanf("%d",&a[i][j]);
		}
	}
	for(p=1;p<=n;p++){
	    for(k=p-1;k<n-1;k++){
		   for(j=0;j<3;j++){
              x=a[p-1][j]-a[k+1][j];
		  
              m=m+x*x;
			 
			  c[w][j]=a[p-1][j];
			  d[w][j]=a[k+1][j];
			 


		   }
		b[w]=sqrt(m);
		w++;
		m=0;
	    
		}
	}
   o=n*(n-1)/2;
	for(l=1;l<=o;l++){
		for(k=0;k<o-l;k++){
			  if(b[k]<b[k+1]){
				  for(j=0;j<3;j++){
				e1=b[k];
				e2=c[k][j];
				e3=d[k][j];
				b[k]=b[k+1];
               c[k][j]=c[k+1][j];
                d[k][j]=d[k+1][j];
                  b[k+1]=e1;
                 c[k+1][j]=e2;
                 d[k+1][j]=e3;
			}
			}
		}
	}
	for(k=0;k<o;k++){
		printf("(");
		printf("%d,%d,%d",c[k][0],c[k][1],c[k][2]);
	    printf(")-(");
		printf("%d,%d,%d",d[k][0],d[k][1],d[k][2]);
		printf(")=");
		printf("%.2lf\n",b[k]);
	}
	return 0;
}
int main(){
	int a[10],b[10],c[10],e,f,g,l,m=0,o[50],p[50],q[50],r[50],s[50],t[50],u,v,w,x,y,z;
	double d[50],n;
	char h='(',i=')',j='-',k='=';
	scanf("%d",&e);
	for(f=0;f<e;f++){
		scanf("%d%d%d",&a[f],&b[f],&c[f]);
	}
	for(f=0;f<(e-1);f++){
		for(g=f+1;g<e;g++){
			l=(a[f]-a[g])*(a[f]-a[g])+(b[f]-b[g])*(b[f]-b[g])+(c[f]-c[g])*(c[f]-c[g]);
			d[m]=sqrt(l);
			o[m]=a[f];
			p[m]=b[f];
			q[m]=c[f];
			r[m]=a[g];
			s[m]=b[g];
			t[m]=c[g];
			m++;
		}
	}
	for(f=0;f<m;f++){
		for(g=f+1;g<m;g++){
			if(d[f]<d[g]){
				n=d[g];
				u=o[g];
				v=p[g];
				w=q[g];
				x=r[g];
				y=s[g];
				z=t[g];
				for(e=g;e>f;e--){
					d[e]=d[e-1];
					o[e]=o[e-1];
					p[e]=p[e-1];
					q[e]=q[e-1];
					r[e]=r[e-1];
					s[e]=s[e-1];
					t[e]=t[e-1];
				}
				d[f]=n;
				o[f]=u;
				p[f]=v;
				q[f]=w;
				r[f]=x;
				s[f]=y;
				t[f]=z;
			}
		}
	}
	for(f=0;f<m;f++){
		printf("%c%d,%d,%d%c%c%c%d,%d,%d%c%c%.2lf\n",h,o[f],p[f],q[f],i,j,h,r[f],s[f],t[f],i,k,d[f]);
	}
	return 0;
}
int main(){
    int n=0,x[11],y[11],z[11],a[51][3];
    double d[50];
    scanf("%d\n",&n);
    for(int i=1;i<=n;i++)
            scanf("%d %d %d ",&x[i],&y[i],&z[i]);
    int cnt=0;
    for(int i=1;i<=n;i++)
            for(int j=i+1;j<=n;j++){
                    int c=++cnt;
                    d[c]=sqrt(sqr(x[i]-x[j])+sqr(y[i]-y[j])+sqr(z[i]-z[j]));
                    a[c][1]=i;
                    a[c][2]=j;
            }
    for(int i=1;i<=cnt;i++)
            for(int j=cnt;j>i;j--)
                    if(d[j-1]<d[j]){
                                    double t1;
                                    int t2,t3;
                                    t1=d[j-1];
                                    d[j-1]=d[j];
                                    d[j]=t1;
                                    t2=a[j-1][1];
                                    t3=a[j-1][2];
                                    a[j-1][1]=a[j][1];
                                    a[j-1][2]=a[j][2];
                                    a[j][1]=t2;
                                    a[j][2]=t3;
                    }
    for(int i=1;i<=cnt;i++)
            printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",
            x[a[i][1]],y[a[i][1]],z[a[i][1]],x[a[i][2]],y[a[i][2]],z[a[i][2]],d[i]);
    return 0;
}
struct POINT {
	int x;
	int y;
	int z;
};
struct DIST {
	int a; 
	int b;
	double dis;
};
int main()
{
	int n,i,j,k,t;
	double td;
	struct POINT point[20];
	struct DIST dists[200];
    scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&point[i].x,&point[i].y,&point[i].z);
	}
	k=0;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			dists[k].a=i;
			dists[k].b=j;
			dists[k].dis=sqrt((point[i].x-point[j].x)*(point[i].x-point[j].x)+
				(point[i].y-point[j].y)*(point[i].y-point[j].y)+(point[i].z-point[j].z)*(point[i].z-point[j].z));
			k++;
		}
	}
	for(i=0;i<k;i++)
	{
		for(j=k-1;j>i;j--)
		{
			if(dists[j].dis>dists[j-1].dis)
			{
				t=dists[j].a;
				dists[j].a=dists[j-1].a;
				dists[j-1].a=t;
				t=dists[j].b;
				dists[j].b=dists[j-1].b;
				dists[j-1].b=t;
				td=dists[j].dis;
				dists[j].dis=dists[j-1].dis;
				dists[j-1].dis=td;
			}
		}
	}
	for(i=0;i<k;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",
			point[dists[i].a].x,point[dists[i].a].y,point[dists[i].a].z,
			point[dists[i].b].x,point[dists[i].b].y,point[dists[i].b].z,
			dists[i].dis);
	}
	return 0;
}
//********************************
//*???????                 **
//*?????? 1200012839        **
//*???2012.12.10              **
//********************************
int main()
{
    int n, k = 0;
    cin >> n;
    struct point
    {
        int x;
        int y;
        int z;
    }point[n];
    struct distance
    {
        int pointa;
        int pointb;
        double d;
    }dis[4950],temp;
    for (int i = 0; i < n; i++)
    {
        cin >> point[i].x >> point[i].y >> point[i].z;
    }
    for (int i=0;i<n-1;i++)
    {
        for (int j=i+1;j<n;j++)
        {
            dis[k].d = sqrt((point[i].x - point[j].x) * (point[i].x - point[j].x)
                          + (point[i].y - point[j].y) * (point[i].y - point[j].y)
                          + (point[i].z - point[j].z) * (point[i].z - point[j].z));
            dis[k].pointa = i;
            dis[k].pointb = j;
            k++;
        }
    }
    for (int i = 0; i < n * (n - 1) / 2 - 1; i++)
    {
        for (int j = i + 1; j < n * (n - 1) / 2; j++)
        {
            if (dis[i].d < dis[j].d)
            {
                temp = dis[i];
                dis[i] = dis[j];
                dis[j] = temp;
            }
            if (dis[i].d == dis[j].d && (dis[i].pointa > dis[j].pointa || dis[i].pointb > dis[j].pointb))
            {
                temp = dis[i];
                dis[i] = dis[j];
                dis[j] = temp;
            }
        }
    }
    for (int i = 0; i < n * (n - 1) / 2; i++)
    {
        cout << "(" << point[dis[i].pointa].x << "," << point[dis[i].pointa].y << "," << point[dis[i].pointa].z << ")" << "-"
             << "(" << point[dis[i].pointb].x << "," << point[dis[i].pointb].y << "," << point[dis[i].pointb].z << ")" << "="
             << fixed << setprecision(2) << dis[i].d << endl;
    }
    return 0;
}
int main()
{
    int n;
    scanf("%d",&n);
    int point[11][3];
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<3;j++)
        {
            scanf("%d",&point[i][j]);
        }    
    }
    double distance[15][15]={0};
    double s;
    for(int i=0;i<n;i++)
    {
        for(int k=1;i+k<n;k++)
        {
            s=sqrt((point[i][0]-point[i+k][0])*(point[i][0]-point[i+k][0])+(point[i][1]-point[i+k][1])*(point[i][1]-point[i+k][1])+(point[i][2]-point[i+k][2])*(point[i][2]-point[i+k][2]));
            distance[i][i+k]=s;    
        }    
    }
    double lenth[105];
    int id[105][2];
    int k=0;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(distance[i][j]==0)
            {
               continue;                  
            }
            id[k][0]=i;
            id[k][1]=j;
            lenth[k]=distance[i][j];
            k++;    
        }    
    }
    double e;
    for(int p=1;p<k;p++)
    {
        for(int i=k-1;i>=p;i--)
        {
            if(lenth[i]>lenth[i-1])
            {
               e=id[i][0];
               id[i][0]=id[i-1][0];
               id[i-1][0]=e;
               e=id[i][1];
               id[i][1]=id[i-1][1];
               id[i-1][1]=e;
               e=lenth[i];
               lenth[i]=lenth[i-1];
               lenth[i-1]=e;                    
            }    
        }    
    }
    for(int i=0;i<k;i++)
    {
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",point[id[i][0]][0],point[id[i][0]][1],point[id[i][0]][2],point[id[i][1]][0],point[id[i][1]][1],point[id[i][1]][2],lenth[i]);    
    }
    scanf("%d",&n);
    return 0;
}
struct
{
	int x;
	int y;
	int z;
} dot[10];
struct
{
	int f1;
	int f2;
	double dis;
} d[55], t;
int main()
{
	int n, i, j, c = 0, x1, y1, z1;
	cin >> n;
	for (i = 0; i < n; i++)
		cin >> dot[i].x >> dot[i].y >> dot[i].z;
	for (i = 0; i < n - 1; i++)
	{
		for (j = i + 1; j < n; j++)
		{
			x1 = (dot[i].x - dot[j].x) * (dot[i].x - dot[j].x);
			y1 = (dot[i].y - dot[j].y) * (dot[i].y - dot[j].y);
			z1 = (dot[i].z - dot[j].z) * (dot[i].z - dot[j].z);
			d[c].f1 = i;
			d[c].f2 = j;
			d[c++].dis = sqrt(x1 + y1 + z1);
		}
	}
	for (i = 0; i < c; i++)
		for (j = c - 1; j > i; j--)
		{
			if (d[j].dis > d[j - 1].dis)
			{
				t = d[j - 1];
				d[j - 1] = d[j];
				d[j] = t;
			}
		}
	for (i = 0; i < c; i++)
	{
		cout << '(' << dot[d[i].f1].x << ',' << dot[d[i].f1].y << ',' << dot[d[i].f1].z << ")-("
			<< dot[d[i].f2].x << ',' << dot[d[i].f2].y << ',' << dot[d[i].f2].z << ")=";
		cout << fixed << setprecision(2) << d[i].dis << endl;
	}
	return 0;
}
int main()
{
	typedef struct _Point
	{
		int x,y,z;
	} Point;
	typedef struct _Distance
	{
		int first, second;
		float dist;
	} Distance;
	Point point[10];
	int n;
	scanf("%d", &n);
	int i,j,total = n*(n-1)>>1;
	n--;
	for(i=0; i<=n; i++)
		scanf("%d%d%d", &point[i].x, &point[i].y, &point[i].z);
	Distance * pDistance = (Distance *)malloc(total * sizeof(Distance));
	int k = 0;
	for(i=0; i<n; i++)
		for(j=i+1; j<=n; j++)
		{
			pDistance[k].first = i;
			pDistance[k].second = j;
			pDistance[k].dist = sqrt((float)((point[i].x-point[j].x)*(point[i].x-point[j].x) +
				(point[i].y-point[j].y)*(point[i].y-point[j].y) +
				(point[i].z-point[j].z)*(point[i].z-point[j].z)));
			k++;
		}
	for(i=1; i<total; i++)
	{
		int tmp = total - i;
		for(j=0; j<tmp; j++)
			if(pDistance[j].dist < pDistance[j+1].dist)
			{
				Distance tmp = pDistance[j];
				pDistance[j] = pDistance[j+1];
				pDistance[j+1] = tmp;
			}
	}
	for(i=0; i<k; i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n", point[pDistance[i].first].x, point[pDistance[i].first].y,
		point[pDistance[i].first].z, point[pDistance[i].second].x, point[pDistance[i].second].y,
		point[pDistance[i].second].z, pDistance[i].dist);
	free(pDistance);
	return 0;
}
int main(){
	int n,i,j,k,l;
	int x[20],y[20],z[20];
	struct
	{
		int x1,y1,z1;
		int x2,y2,z2;
		double dis;
	}
	out[50],h;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	}
	k=0;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			out[k].x1=x[i];
			out[k].y1=y[i];
			out[k].z1=z[i];
			out[k].x2=x[j];
			out[k].y2=y[j];
			out[k].z2=z[j];
			k++;
		}
	}
	for(i=0;i<n*(n-1)/2;i++)
	{
		out[i].dis=sqrt((out[i].x1-out[i].x2)*(out[i].x1-out[i].x2)
			+(out[i].y1-out[i].y2)*(out[i].y1-out[i].y2)
			+(out[i].z1-out[i].z2)*(out[i].z1-out[i].z2));
	}
	for(i=0;i<n*(n-1)/2;i++)
	{
		for(j=n*(n-1)/2-1;j>i;j--)
		{
			if(out[j].dis>out[j-1].dis)
			{
				h=out[j];
				out[j]=out[j-1];
				out[j-1]=h;
			}
		}
	}
	for(i=0;i<n*(n-1)/2;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",out[i].x1,
			out[i].y1,out[i].z1,out[i].x2,out[i].y2,out[i].z2
			,out[i].dis);
	}
	return 0;
}
struct
{
	float a;
	int f,g;
}s[50],temp;
void main()
{
	int n,i,j,x[10],y[10],z[10];
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d%d%d",&x[i],&y[i],&z[i]);
	int t=0;
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
		{
			s[t].a=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]));
			s[t].f=i;
			s[t].g=j;
			t++;
		}
	for(i=0;i<t-1;i++)
		for(j=0;j<t-i-1;j++)
			if(s[j].a<s[j+1].a)
			{
				temp=s[j];
				s[j]=s[j+1];
				s[j+1]=temp;
			}
	for(i=0;i<t;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[s[i].f],y[s[i].f],z[s[i].f],x[s[i].g],y[s[i].g],z[s[i].g],s[i].a);
}
struct dis{
	int p1[3];
	int p2[3];
	double d;
};
void main()
{
	int a[10][3],i,j,k,r,n;
	struct dis dt[45],t;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		for (j=0;j<3;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	for (i=0,r=0;i<n;i++)
	{
		for (j=i+1;j<n;j++)
		{
			for (dt[r].d=0,k=0;k<3;k++)
			{
				dt[r].p1[k]=a[i][k];
				dt[r].p2[k]=a[j][k];
				dt[r].d+=(a[i][k]-a[j][k])*(a[i][k]-a[j][k]);
			}
			dt[r].d=sqrt(dt[r].d);
			r++;
		}
	}
	for (r=1;r<n*(n-1)/2;r++)
	{
		for (k=0;k<n*(n-1)/2-r;k++)
		{
			if (dt[k].d<=dt[k+1].d) 
			{
				t=dt[k];
				dt[k]=dt[k+1];
				dt[k+1]=t;
			}
		}
	}
	for (i=r-1;dt[i].d==dt[i-1].d;i--);
	for (j=r-1;j>i;j--)
	{
		for (k=r-1;k>=i+r-j;k--)
		{
			t=dt[k];
			dt[k]=dt[k-1];
			dt[k-1]=t;
		}
	}
		
	for (i=0;i<r;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",dt[i].p1[0],dt[i].p1[1],dt[i].p1[2],dt[i].p2[0],dt[i].p2[1],dt[i].p2[2],dt[i].d);
	}
}
double sqrt(double x);
int main(){
   int n;
   int sz[10][3];
   int f=0;
   double jl[100];
   int zbx[100],zby[100];
   scanf("%d",&n);
   for(int s=0;s<n;s++){
	   for(int c=0;c<3;c++){
	       scanf("%d",&sz[s][c]);
	   }
   
   }
   for(int r=0;r<n;r++){
	   for(int t=r+1;t<n;t++){
	       jl[f]=sqrt(((sz[r][0]-sz[t][0])*(sz[r][0]-sz[t][0]))+((sz[r][1]-sz[t][1])*(sz[r][1]-sz[t][1]))+((sz[r][2]-sz[t][2])*(sz[r][2]-sz[t][2])));
		   zbx[f]=r;
		   zby[f]=t;
	       f++;
	   }
   
   }
   for(int k=1;k<=f;k++){
      int b,p;
	  double e;
	  for(int m=0;m<f-k;m++){
		  if(jl[m]<jl[m+1]){
		     e=jl[m];b=zbx[m];p=zby[m];
			 jl[m]=jl[m+1];zbx[m]=zbx[m+1];zby[m]=zby[m+1];
			 jl[m+1]=e;zbx[m+1]=b;zby[m+1]=p;
		  
		  }
	  
	  }
   
   }
   for(int q=0;q<f;q++){
	   printf("(");
	   for(int l=0;l<2;l++){
	       printf("%d,",sz[zbx[q]][l]);
	   }
       printf("%d)",sz[zbx[q]][2]);
	   printf("-(");
	   for(int h=0;h<2;h++){
	       printf("%d,",sz[zby[q]][h]);
	   }
	    printf("%d)=",sz[zby[q]][2]);
		printf("%.2lf\n",jl[q]);


   
   
   }
   return 0;

}
struct point{
	int a[3];
	int b[3];
	double distant;
}p[45],change;
void swap(struct point p[],int k);
void main()
{
	int i,j,k=0,n;
	int x[10],y[10],z[10];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	for(j=0;j<n-1;j++)
		for(i=j+1;i<n;i++){
			p[k].a[0]=x[j];
			p[k].a[1]=y[j];
			p[k].a[2]=z[j];
			p[k].b[0]=x[i];
			p[k].b[1]=y[i];
			p[k].b[2]=z[i];
			p[k++].distant=sqrt(pow(x[j]-x[i],2)+pow(y[j]-y[i],2)+pow(z[j]-z[i],2));
		}
	swap(p,k-1);
	for(i=0;i<k;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",p[i].a[0],p[i].a[1],p[i].a[2],p[i].b[0],p[i].b[1],p[i].b[2],p[i].distant);
}
void swap(struct point p[],int k)
{
	int r,q;
	for(r=0;r<k;r++)
		for(q=0;q<k-r;q++)
			if(p[q].distant<p[q+1].distant){
				change=p[q];
				p[q]=p[q+1];
				p[q+1]=change;
			}
}
int main() {
	int n,a[1000][3],i,j,x,e;
	double jl[1000][1000],m,k;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&a[i][0],&a[i][1],&a[i][2]);
	}
	k=0;
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			m=(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]);
			jl[i][j]=sqrt(1.0*m);
			if(k<jl[i][j]){
				k=jl[i][j];
			}
		}
	}
	for(x=1;x<=n*(n-1)/2;x++){
		e=0;
		for(i=0;i<n-1;i++){
			for(j=i+1;j<n;j++){
				if(k==jl[i][j] && e==0){
				printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i][0],a[i][1],a[i][2],a[j][0],a[j][1],a[j][2],jl[i][j]);
				jl[i][j]=0;
				k=0;
				e=1;
				}
			}
		}
		for(i=0;i<n-1;i++){
			for(j=i+1;j<n;j++){
				if(k<jl[i][j]){
					k=jl[i][j];
				}
			}
		}
	}
	return 0;
}
struct District
	{
		int x;
		int y;
		int z;
	}dis[11];//????
struct Distance
	{
		int a;
		int b;
		double c;
	}d[91],temp;//?????????
int main()
{
	int n,k=1;
	cin>>n;
	
	for(int i=1;i<=n;i++)
	{
		cin>>dis[i].x>>dis[i].y>>dis[i].z;
	}
	for(int i=1;i<n;i++)
	{
		for(int j=i+1;j<=n;j++)
		{
			d[k].a=i;
			d[k].b=j;
			d[k].c=sqrt((double)(dis[i].x-dis[j].x)*(dis[i].x-dis[j].x)+(dis[i].y-dis[j].y)*(dis[i].y-dis[j].y)+(dis[i].z-dis[j].z)*(dis[i].z-dis[j].z));
			k++;
		}
	}//?i????j?????
	for(int i=1;i<=k-2;i++)
	{
		for(int j=1;j<=k-i;j++)
		{
			if(d[j].c<d[j+1].c)
			{
			temp=d[j];
			d[j]=d[j+1];
			d[j+1]=temp;
			}
		}
	}//??????
	for(int i=1;i<=k-1;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",dis[d[i].a].x,dis[d[i].a].y,dis[d[i].a].z,dis[d[i].b].x,dis[d[i].b].y,dis[d[i].b].z,d[i].c);
	}//??

	return 0;
}
double a[10000],g[10000];
void mppx(double a[],int n);
int main()
{
	int n,i,j,k,l,v,w;
	double d,e,f;
	struct b{
		double x,y,z;
	}c[1000];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%lf%lf%lf",&(c[i].x),&(c[i].y),&(c[i].z));
	}
	j=0;
	k=1;
	for(i=0;i<(n-1)*n/2;i++){
		d=(c[j].x-c[k].x)*(c[j].x-c[k].x);
	    e=(c[j].y-c[k].y)*(c[j].y-c[k].y);
		f=(c[j].z-c[k].z)*(c[j].z-c[k].z);
		if(e<0){
			e=-e;
		}
		if(f<0){
			f=-f;
		}
		if(d<0){
			d=-d;
		}
		a[i]=d+e+f;
		a[i]=sqrt(a[i]);
		k++;
		if(k==n){
			j++;
			k=j+1;
		}
	}
	mppx(a,n*(n-1)/2);
	l=0;
	v=n-1;
	for(i=0;i<(n-1)*n/2;i++){
		for(j=0;j<(n-1)*n/2;j++){
			if(a[j]==g[i]){
				for(w=j;w>=v;j=j){
					if(w>=v){
						l++;
						w=w-v+l;
					}
				}
				printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",(int)(c[l].x),(int)(c[l].y),(int)(c[l].z),(int)(c[w+1].x),(int)(c[w+1].y),(int)(c[w+1].z),g[i]);
				a[j]=0;
				l=0;
				break;
			}
		}
	}
	return 0;
}
void mppx(double a[],int n){
	int i,j;
	double t;
	for(i=0;i<n;i++){
		g[i]=a[i];
	}
	for(i=0;i<n-1;i++){
		for(j=n-2;j>=0;j--){
			if(g[j]<g[j+1]){
				t=g[j];
				g[j]=g[j+1];
				g[j+1]=t;
			}
		}
	}
}