semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/**
 *@ file    1000012834_005homework.cpp
 *@ author  ???
 *@ date    2010-12-15
 *@ description 
 *          ???????????
 */
struct position	// ??????????????????
{
	double distance[1000];
	int x;
	int y;
	int z;

}pos[1000];	// ?????????????pos
struct str	// ???????????????????
{
	int point1;
	int point2; 
	double distance;
}length[100], temp;	// length?????????,temp???????
int main()
{
	
	// ??????n,????i,j?????k,??????????num,???????????????
	int n, i, j, k, num;	
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> pos[i].x >> pos[i].y >> pos[i].z;
	}
	num= 0;	// ?????
	for (i = 1; i <= n; i++)	// ???????????????????length??
	{
		k = 0;					// ???????1????????????????
		for (j = i + 1; j <= n; j++)
		{
			k++;				// ??????
			num++;				// ??????????+1

			// ????????????
			pos[i].distance[k] = (pos[i].x - pos[j].x) * (pos[i].x - pos[j].x) 
								+ (pos[i].y - pos[j].y) * (pos[i].y - pos[j].y)
								+ (pos[i].z - pos[j].z) * (pos[i].z - pos[j].z);

			// ????????????length??
			length[num].point1 = i;
			length[num].point2 = j;
			length[num].distance = pos[i].distance[k];
		}
	}

	// ??????????????????
	for (i = 1; i < num; i++)
		for (j = 1; j <= num - i; j++)
		{
			if(length[j].distance < length[j + 1].distance)
			{
				temp = length[j];
				length[j] = length[j + 1];
				length[j + 1] = temp;
			}
		}

	// ????????????
	for (i = 1; i <= num; i++)
	{
		cout << "(" 
			<< pos[length[i].point1].x 
			<< "," << pos[length[i].point1].y 
			<< "," << pos[length[i].point1].z 
			<< ")" << "-" <<  "(" 
			<< pos[length[i].point2].x 
			<< "," << pos[length[i].point2].y 
			<< "," << pos[length[i].point2].z 
			<< ")" << "="
			<< fixed << setprecision(2) << sqrt(length[i].distance) 
			<< endl;
	}

	return 0;
}
/*??????
????????n??????10??,??n?????????,
???????????????????????????
????
????????????????n??????????????????(??????)?
????????0?100????????????????
????
?????n????????n*(n-1)/2???????????
(x1,y1,z1)-(x2,y2,z2)=??
???????????2?? */
int main()
{
	int n;cin>>n;
	int x[n+1],y[n+1],z[n+1];float dst[n*n]; int sma[n*n], lar[n*n];//dst=distance;sma??????lar?dst??,???????????
	int count=0;
	float t;
    for( int i=1; i<=n; ++i )
	{
    	cin>>x[i]>>y[i]>>z[i];
    }
    for( int e=1; e<=n; e++ )for(int e1=e+1; e1<=n; ++e1 )
    {
    	++count;
    	sma[count]=e;lar[count]=e1;
    	dst[count]=sqrt((x[e]-x[e1])*(x[e]-x[e1])+(y[e]-y[e1])*(y[e]-y[e1])+(z[e]-z[e1])*(z[e]-z[e1]));
    }
    for(int e=1; e<=count-1; ++e )//???
	for( int i=1; i<=count-e ;++i )
	{
		if ( dst[i]<dst[i+1] )
		{
			t=dst[i]; dst[i]=dst[i+1]; dst[i+1]=t;
			t=sma[i]; sma[i]=sma[i+1]; sma[i+1]=(int)t;
			t=lar[i]; lar[i]=lar[i+1]; lar[i+1]=(int)t;

		}
	}
	for ( int e=1; e<=count ; ++e )
	printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[sma[e]],y[sma[e]],z[sma[e]],x[lar[e]],y[lar[e]],z[lar[e]],dst[e]);
	return 0;
}
struct point{
    int x;
    int y;
    int z;
};
int main(){
    int n,i,j,k=0,c;
    double R[1000];
    double t;
    struct point A[10],B[100],C[100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d%d%d",&A[i].x,&A[i].y,&A[i].z);
    }
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
           B[k].x=A[i].x;B[k].y=A[i].y;B[k].z=A[i].z;
           C[k].x=A[j].x;C[k].y=A[j].y;C[k].z=A[j].z;
           R[k]=sqrt(pow(1.0*(B[k].x-C[k].x),2)+pow(1.0*(B[k].y-C[k].y),2)+pow(1.0*(B[k].z-C[k].z),2));
           k++;
        }
    }
    for(i=0;i<k;i++){
        for(j=k-1;j>i;j--){
            if(R[j]>R[j-1]){
                t=R[j]; R[j]=R[j-1];R[j-1]=t;
                c=B[j].x;B[j].x=B[j-1].x;B[j-1].x=c;
                c=B[j].y;B[j].y=B[j-1].y;B[j-1].y=c;
                c=B[j].z;B[j].z=B[j-1].z;B[j-1].z=c;
                c=C[j].x;C[j].x=C[j-1].x;C[j-1].x=c;
                c=C[j].y;C[j].y=C[j-1].y;C[j-1].y=c;
                c=C[j].z;C[j].z=C[j-1].z;C[j-1].z=c;
            }
        }
    }
    for(i=0;i<k;i++){
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",B[i].x,B[i].y,B[i].z,C[i].x,C[i].y,C[i].z,R[i]);
    }
      return 0;  
    
}
int x[11],y[11],z[11],cnt,n,dist[105];
int getdist(int i,int j){
    return (x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]);
}
int main(){
    cin>>n;
    for(int i=1;i<=n;i++)
       cin>>x[i]>>y[i]>>z[i];
    for(int i=1;i<n;i++)
       for(int j=i+1;j<=n;j++)
          dist[++cnt]=getdist(i,j);
    sort(dist+1,dist+1+cnt);             //???? ????
    for(int k=cnt;k>=1;k--)if(dist[k]!=dist[k-1])     //??????????????
       for(int i=1;i<n;i++)
          for(int j=i+1;j<=n;j++)
             if(getdist(i,j)==dist[k])
               printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[i],y[i],z[i],x[j],y[j],z[j],(double)(sqrt(dist[k])));//???? ????????
    
    return 0;
}
int main(){
int n,sf;
scanf("%d",&n);
int k=0;
int x[10],y[10],z[10],a[200],b[200];
double s[200];
for(int i=0;i<n;i++){
scanf("%d %d %d",&x[i],&y[i],&z[i]);
}
for (int i=0;i<n;i++){
 for(int j=i+1;j<n;j++){
    sf=(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[k]=sqrt(sf); 
    a[k]=i;
    b[k]=j;
     k++;
       }
    }
    int l;
    double u;
for(int q=1;q<k;q++){
 for(int w=0;w<k-q;w++){
   if(s[w]<s[w+1]){
    u=s[w];
    s[w]=s[w+1];
   s[w+1]=u;
     l=a[w];
    a[w]=a[w+1];
   a[w+1]=l; 
    l=b[w];
    b[w]=b[w+1];
   b[w+1]=l;
  
   }
  }
}
for(int i=0;i<k;i++){
printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[a[i]],y[a[i]],z[a[i]],x[b[i]],y[b[i]],z[b[i]],s[i]);
}
return 0;
 }
int r(int k,int n)
{
	int i;
	for(i=n-1;k>i;i--)
		k-=i;
	return(n-i-1);
}
int p(int k,int n)
{
	int i;
	for(i=n-1;k>i;i--)
		k-=i;
	return(n-i+k-1);
}
void main()
{
	int n,i,j,k=0,q[50],t,g,h;
	float y[50];
	struct point{int a;
	int b;
	int c;
	}x[12];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d%d%d",&x[i].a,&x[i].b,&x[i].c);
	for(i=0;i<n;i++)
		for(j=i+1;j<n;j++,k++)
			y[k]=sqrt((x[i].a-x[j].a)*(x[i].a-x[j].a)+(x[i].b-x[j].b)*(x[i].b-x[j].b)+(x[i].c-x[j].c)*(x[i].c-x[j].c));
		for(i=0;i<=n*(n-1)/2;i++)
			q[i]=i;
	for(i=0;i<n*(n-1)/2-1;i++)
		for(j=0;j<n*(n-1)/2-1-i;j++)
			if(y[q[j]]<y[q[j+1]])
			{t=q[j];
			q[j]=q[j+1];
			q[j+1]=t;
			}
		for(i=0;i<n*(n-1)/2;i++)
	{
		g=r(q[i]+1,n);
		h=p(q[i]+1,n);
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[g].a,x[g].b,x[g].c,x[h].a,x[h].b,x[h].c,y[q[i]]);
	}
		
}
int main(){
	int n,i,j,dx,dy,dz,o=0;
	scanf("%d",&n);
	int x[10],y[10],z[10];
	double ji[100];
	for(i=0;i<n;i++){
	scanf("%d%d%d",&(x[i]),&(y[i]),&(z[i]));
}struct pp{
	int xi[2],yi[2],zi[2];
	double jl;
	}pp[100],e;
	for(i=0;i<n;i++){
		for(j=i+1;j<n;j++){
		dx=x[j]-x[i];
		dy=y[j]-y[i];
		dz=z[j]-z[i];
		pp[o].xi[0]=x[i];
		pp[o].xi[1]=x[j];
		pp[o].yi[0]=y[i];
		pp[o].yi[1]=y[j];
		pp[o].zi[0]=z[i];
		pp[o].zi[1]=z[j];
		pp[o].jl=sqrt(dx*dx+dy*dy+dz*dz);
		o++;	
		}
	}
	for(i=0;i<n*(n-1)/2;i++){
		for(j=n*(n-1)/2-1;j>=i+1;j--){
			if(pp[j].jl>pp[j-1].jl){
				e=pp[j-1];
				pp[j-1]=pp[j];
				pp[j]=e;
			}
		}
	}for(i=0;i<n*(n-1)/2;i++){
	printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",pp[i].xi[0],pp[i].yi[0],pp[i].zi[0],pp[i].xi[1],pp[i].yi[1],pp[i].zi[1],pp[i].jl);
}
	return 0;
}
//**********************
//* ??? ????    *
//* 1200012878 ???  *
//* 12?15?           *
//**********************
struct dian
{
	int a;
	int b;
	int c;
} p[10]; // ??????????
struct len
{
	int s;
	int m;
	double dis;
} q[45]; // ?????????????
int main()
{
	int n, count = -1, i, j, k, temp1, temp2;
	double temp3;
	cin >> n;
	for (i = 0; i < n; i++)
		cin >> p[i].a >> p[i].b >> p[i].c; // ???????
	for (j = 0; j < n - 1; j++)
	{
		for (k = j + 1; k < n; k++)
		{
			count++;
			q[count].dis = sqrt((p[j].a - p[k].a) * (p[j].a - p[k].a) + 
					(p[j].b - p[k].b) * (p[j].b - p[k].b) + 
					(p[j].c - p[k].c) * (p[j].c - p[k].c));
			q[count].s = j;
			q[count].m = k;
		}
	} // ??????????
	for(i = 0; i < count; i++)
	{
		for (j = count - 1; j >= i; j--)
		{
			if (q[j].dis < q[j + 1].dis)
			{
				temp1 = q[j].s;
				temp2 = q[j].m;
				temp3 = q[j].dis;
				q[j].s = q[j + 1].s;
				q[j].m = q[j + 1].m;
				q[j].dis = q[j + 1].dis;
				q[j + 1].s = temp1;
				q[j + 1].m = temp2;
				q[j + 1].dis = temp3;
			}
		}
	} // ??????????????????????????????????
	for (i = 0; i <= count; i++)
		cout << "(" << p[q[i].s].a << "," << p[q[i].s].b << "," << p[q[i].s].c << ")" << "-"
		<< "(" << p[q[i].m].a << "," << p[q[i].m].b << "," << p[q[i].m].c << ")" << "=" <<
		setprecision(2) << fixed << q[i].dis << endl; // ?????
	return 0;
}
int main()
{
    int n,b,c;
	scanf("%d",&n);
	int i,j,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],k,y[51],z[51];
	double l[51];
	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++;
		   }
	}
	int e,g;
	double f;
	for(k=1;k<=i;k++)
	{
		for(j=0;j<(i-k);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(j=0;j<i;j++)
	{
		
		b=y[j];
		c=z[j];
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",sa[b],sb[b],sc[b],sa[c],sb[c],sc[c],l[j]);
	}
	return 0;
}
int main() {
	int n, j, i, k = 0, m;
	float p = 0, a[100] = { 0 };
	int x[10], y[10], z[10];
	float s[10][10] = { 0 };
	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++) {
			a[k++] = s[i][j] = (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 (i = 0; i < k - 1; i++) {//??
		for (j = 0; j < k - 1 - i; j++) {
			if (a[j] < a[j + 1]) {
				p = a[j];
				a[j] = a[j + 1];
				a[j + 1] = p;
			}
		}
	}
	for (j = 0; j < n; j++) {
		for (i = 0; i < n; i++) {
			if (a[0] == s[i][j])
				printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n", x[i], y[i], z[i], x[j],
						y[j], z[j], sqrt(a[0]));
		}
	}
	for (m = 1; m < k; m++) {
		for (j = 0; j < n; j++) {
			for (i = 0; i < n; i++) {
				if (a[m] == s[i][j] && a[m] != a[m - 1])
					printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n", x[i], y[i], z[i],
							x[j], y[j], z[j], sqrt(a[m]));
			}
		}
	}
	return 0;
}
int main(){
	int n,a[10],b[10],c[10],i;
	double d[10][10],e[45];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&a[i],&b[i],&c[i]);
	}
	int k,t=0;
	for(i=0;i<n;i++){
		for(k=i+1;k<n;k++){
			d[i][k]=sqrt((a[i]-a[k])*(a[i]-a[k])+(b[i]-b[k])*(b[i]-b[k])+(c[i]-c[k])*(c[i]-c[k]));
			e[t]=d[i][k];
			t++;
		}
	}
	for(t=0;t<n*(n-1)/2-1;t++){
		for(i=n*(n-1)/2-1;i>t;i--){
			if(e[i]>e[i-1]){
				double m;
				m=e[i];
				e[i]=e[i-1];
				e[i-1]=m;
			}
		}
	}
	for(t=0;t<n*(n-1)/2;t++){
		for(i=0;i<n;i++){
			for(k=i+1;k<n;k++){
				if(d[i][k]==e[t]){
					printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i],b[i],c[i],a[k],b[k],c[k],e[t]);
					d[i][k]=0;
					k=n;
					i=n;
				}
			}
		}
	}
	return 0;
}
struct pl
{
	float s[3];
};
struct pl p[10];
struct place
{
	struct pl y;
	struct pl x;
	float p;
};
struct place q[45];
struct place qx;
int main()
{
	int n,m,i,j,k=0,l,r,v;
	scanf("%d",&n);
	m=n*(n-1)/2;
	for(i=0;i<=n-1;i++)
	{
		scanf("%f %f %f",&p[i].s[0],&p[i].s[1],&p[i].s[2]);
	}
	for(i=0;i<=n-1;i++)
	{
		for(j=i+1;j<=n-1;j++)
		{
			q[k].y=p[i];
			q[k].x=p[j];
			q[k].p=sqrt( (p[i].s[0]-p[j].s[0])*(p[i].s[0]-p[j].s[0])+(p[i].s[1]-p[j].s[1])*(p[i].s[1]-p[j].s[1])+(p[i].s[2]-p[j].s[2])*(p[i].s[2]-p[j].s[2]) );
			k++;
		}
	}
	for(l=0;l<=m-1;l++)
	{
		for(r=0;r<=m-1-l;r++)
		{
			if(q[r].p<q[r+1].p)
			{
				qx=q[r];
				q[r]=q[r+1];
				q[r+1]=qx;
			}
		}
	}
	for(v=0;v<=m-1;v++)
	{
		printf("(%g,%g,%g)-(%g,%g,%g)=%.2lf\n",q[v].y.s[0],q[v].y.s[1],q[v].y.s[2],q[v].x.s[0],q[v].x.s[1],q[v].x.s[2],q[v].p);
	}
}
int main()
{
	int n;
	cin>>n;
	float x[n],y[n],z[n],a[(n-1)*n/2],va;
	for(int i=0;i<n;i++)
	{
		cin>>x[i]>>y[i]>>z[i];
	}
	for(int i=0,k=0;i<n-1;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			a[k]=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]));
			k=k+1;
		}
	}
	for(int i=0;i<(n-1)*n/2-1;i++)
	{
		for(int j=0;j<(n-1)*n/2-1-i;j++)
		{
			if(a[j]<=a[j+1])
			{
				va=a[j];
				a[j]=a[j+1];
				a[j+1]=va;
			}
		}
	}
	for(int i=0;i<(n-1)*n/2;i++)
	{
		if((a[i]==a[i+1])&&(i!=(n-1)*n/2-1))
		continue;
		else
		{
			for(int j=0;j<n-1;j++)
		    {
			    for(int k=j+1;k<n;k++)
			    {
				    if(a[i]==sqrt((x[j]-x[k])*(x[j]-x[k])+(y[j]-y[k])*(y[j]-y[k])+(z[j]-z[k])*(z[j]-z[k])))
				    {
					    if(i==0)
					    printf("(%.0f,%.0f,%.0f)-(%.0f,%.0f,%.0f)=%.2f",x[j],y[j],z[j],x[k],y[k],z[k],a[i]);
					    else
					    printf("\n(%.0f,%.0f,%.0f)-(%.0f,%.0f,%.0f)=%.2f",x[j],y[j],z[j],x[k],y[k],z[k],a[i]);
				    }
			    }
		    }
	    }
	}
	
	return 0;	
}
int main()
{
    float point[10][3],lon[100],tem1;
    int n,i,j,sum=0,x[100],y[100],tem;
    cin>>n;
    for(i=0;i<n;i++)
    cin>>point[i][0]>>point[i][1]>>point[i][2];
    for(i=0;i<n;i++)
    for(j=i+1;j<n;j++)
    {
        lon[sum]=sqrt((point[i][0]-point[j][0])*(point[i][0]-point[j][0])+(point[i][1]-point[j][1])*(point[i][1]-point[j][1])+(point[i][2]-point[j][2])*(point[i][2]-point[j][2]));
        x[sum]=i;
        y[sum++]=j;
    }
    for(i=0;i<sum-1;i++)
    for(j=0;j<sum-i-1;j++)
    {
        if(lon[j]<lon[j+1])
        {
            tem1=lon[j];
            lon[j]=lon[j+1];
            lon[j+1]=tem1;
            tem=x[j];
            x[j]=x[j+1];
            x[j+1]=tem;
            tem=y[j];
            y[j]=y[j+1];
            y[j+1]=tem;
        }
    }
    for(i=0;i<sum;i++)
    {
        cout<<'(';
        cout<<point[x[i]][0]<<','<<point[x[i]][1]<<','<<point[x[i]][2]<<')';
        cout<<'-';
        cout<<'(';
        cout<<point[y[i]][0]<<','<<point[y[i]][1]<<','<<point[y[i]][2]<<')';
        cout<<'=';
        printf("%.2f",lon[i]);
        cout<<endl;
    }
}
int x[10],y[10],z[10],k=0,d[100]={0},e[100]={0},i,j,k,n;
double c[100]={0},temp;
int main()
{
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d %d %d",&x[i],&y[i],&z[i]);
    }
    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
        {
            c[k]=sqrt(  pow(x[i]-x[j],2)+ pow(y[i]-y[j],2)+pow(z[i]-z[j],2)   );
            d[k]=i;
            e[k]=j;
            k++;

        }
    }
    for(i=0;i<k;i++)
    {
        for(j=i+1;j<k;j++)
        {
            if(c[i]<c[j])
            {
                temp=c[i];c[i]=c[j];c[j]=temp;
                temp=d[i];d[i]=d[j];d[j]=temp;
                temp=e[i];e[i]=e[j];e[j]=temp;
            }
            if( (c[i]==c[j])&& ((d[i]>d[j])||(e[i]>e[j])))
            {
                temp=c[i];c[i]=c[j];c[j]=temp;
                temp=d[i];d[i]=d[j];d[j]=temp;
                temp=e[i];e[i]=e[j];e[j]=temp;
            }
        }
    }
    for(i=0;i<k;i++)
    {
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[d[i]],y[d[i]],z[d[i]],x[e[i]],y[e[i]],z[e[i]],c[i]);
    }
    return 0;
}
int main()
{
int sz1[100],sz2[100],sz3[100],n,i,j,k=0,r,a[100],b[100];
double q[10][10],p[10][10],temp,m[72];
scanf("%d",&n);
for(i=0;i<=n-1;i++)
    {
    scanf("%d%d%d",&sz1[i],&sz2[i],&sz3[i]);
    }
for(i=0;i<=n-1;i++)
    {
    for(j=i+1;j<=n-1;j++)
    	{
        	q[i][j]=1.0*((sz1[i]-sz1[j])*(sz1[i]-sz1[j])+(sz2[i]-sz2[j])*(sz2[i]-sz2[j])+(sz3[i]-sz3[j])*(sz3[i]-sz3[j]));
		p[i][j]=sqrt(q[i][j]);
        	m[k]=p[i][j];
		a[k]=i;
		b[k]=j;
        	k=k+1;
		}
	}
for(r=0;r<(n*(n-1)/2);r++)
    {
        for(k=0;k<=n*(n-1)/2-2;k++)
            {
                if(m[k]<m[k+1])
                    {
                        temp=m[k];
                        m[k]=m[k+1];
                        m[k+1]=temp;
        	temp=a[k];
			a[k]=a[k+1];
			a[k+1]=temp;
			temp=b[k];
			b[k]=b[k+1];
			b[k+1]=temp;
		}
            }
    }
for(k=0;k<(n*(n-1))/2;k++)
	{
    printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",sz1[a[k]],sz2[a[k]],sz3[a[k]],sz1[b[k]],sz2[b[k]],sz3[b[k]],m[k]);
	}
return 0;
}
int main()
{
	int n,j=0,b;
    int a[15][3];
	double s[10000];
	int x[10000][2];
	double p;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i][0]>>a[i][1]>>a[i][2];
	}
	for(int k=0;k<n-1;k++)
	{
	for(int m=k+1;m<n;m++)
	{
		s[j]=sqrt((a[k][0]-a[m][0])*(a[k][0]-a[m][0])+(a[k][1]-a[m][1])*(a[k][1]-a[m][1])+(a[k][2]-a[m][2])*(a[k][2]-a[m][2]));
		x[j][0]=k;
		x[j][1]=m;
				j++;
	}
	}
	for(int z=0;z<j-1;z++)
	{
		for(int d=0;d<j-1-z;d++)
		{
			if(s[d]<s[d+1])
			{
				p=s[d+1];
				s[d+1]=s[d];
				s[d]=p;
				b=x[d+1][0];
				x[d+1][0]=x[d][0];
				x[d][0]=b;
				b=x[d+1][1];
				x[d+1][1]=x[d][1];
				x[d][1]=b;
			}
		}
	}
	for(int g=0;g<j;g++)
	{
	cout<<"("<<a[x[g][0]][0]<<","<<a[x[g][0]][1]<<","<<a[x[g][0]][2]<<")"<<"-"<<"("<<a[x[g][1]][0]<<","<<a[x[g][1]][1]<<","<<a[x[g][1]][2]<<")"<<"="<<fixed<<setprecision(2)<<s[g]<<endl;
	}
	return 0;
}
struct distance
{
	int sp1x;
	int sp1y;
	int sp1z;
	int sp2x;
	int sp2y;
	int sp2z;
	double dis;
} dis[999999],temp;
int main()
{
	int n,spot[9999][3]={0},t=0;
	cin>>n;
	for (int i=0;i<n;i++)
		cin>>spot[i][0]>>spot[i][1]>>spot[i][2];
	for (int i=0;i<n-1;i++)
		for (int j=i+1;j<n;j++)
		{
			dis[t].sp1x=spot[i][0];
			dis[t].sp1y=spot[i][1];
			dis[t].sp1z=spot[i][2];
			dis[t].sp2x=spot[j][0];
			dis[t].sp2y=spot[j][1];
			dis[t].sp2z=spot[j][2];
			dis[t].dis=sqrt(pow(spot[i][0]-spot[j][0],2.0) + pow(spot[i][1]-spot[j][1],2.0) + pow(spot[i][2]-spot[j][2],2.0));
			t++;
		}
	for (int i=0;i<=t-2;i++)
		for (int j=0;j<=t-2-i;j++)
			if (dis[j].dis<dis[j+1].dis)
			{
				temp=dis[j];
				dis[j]=dis[j+1];
				dis[j+1]=temp;
			}
	for (int i=0;i<t;i++)
		cout<<"("<<dis[i].sp1x<<","<<dis[i].sp1y<<","<<dis[i].sp1z<<")-("<<dis[i].sp2x<<","<<dis[i].sp2y<<","<<dis[i].sp2z<<")="
		<<fixed<<setprecision(2)<<dis[i].dis<<endl;
	return 0;
}
struct point
{int x;
int y;
int z;
}p[10];

void distance(int n)
{int i,j,k=0;
double t,d[10][10]={0},D[45]={0};
for(i=0;i<n-1;i++)
{for(j=i+1;j<n;j++)
{d[i][j]=sqrt((p[i].x-p[j].x)*(p[i].x-p[j].x)+(p[i].y-p[j].y)*(p[i].y-p[j].y)+(p[i].z-p[j].z)*(p[i].z-p[j].z));
D[k]=d[i][j];
k++;}}
for(i=0;i<n*(n-1)/2-1;i++)
{for(j=0;j<n*(n-1)/2-i-1;j++)
{if(D[j]<D[j+1])
{t=D[j];
D[j]=D[j+1];
D[j+1]=t;}}}
for(k=0;k<n*(n-1)/2;k++)
{if(D[k]==D[k+1])
continue;
else
{for(i=0;i<n-1;i++)
{for(j=i+1;j<n;j++)
if(d[i][j]==D[k])
{printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",p[i].x,p[i].y,p[i].z,p[j].x,p[j].y,p[j].z,d[i][j]);}}}}
}

int main()
{
int n,i;
scanf("%d",&n);
for(i=0;i<n;i++)
{scanf("%d%d%d",&p[i].x,&p[i].y,&p[i].z);}
distance(n);
return 0;
}
int main()
{
	typedef  struct {
        int a[3];
        int b[3];
        float dis;
	} juli;
   int n,m=0,i,j,k,x,y;
   scanf("%d",&n);
   int c[10][3];
   for(i=0;i<n;i++)
   scanf("%d %d %d",&c[i][0],&c[i][1],&c[i][2]);
   juli d[50];
   juli temp;
   for(i=0;i<n-1;i++)
    {for(j=i+1;j<n;j++)
    {
   	    x=0;
   	   for(k=0;k<3;k++)
   	   {
   	   	d[m].a[k]=c[i][k];
   	   	d[m].b[k]=c[j][k];
   	   	x+=(c[i][k]-c[j][k])*(c[i][k]-c[j][k]);
   	   }
   	   d[m].dis=sqrt(fabs(x));
   	   m++;
    }}
    k=m;
   for(;m;m--)
   {
   	for(i=0;i<m-1;i++)
   	{
	   	if(d[i].dis<d[i+1].dis)
	   	{
	   		temp=d[i];
	   		d[i]=d[i+1];
	   		d[i+1]=temp;
	   	}
    }
   }
   for(i=0;i<k;i++)
   {
   	printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",d[i].a[0],d[i].a[1],d[i].a[2],d[i].b[0],d[i].b[1],d[i].b[2],d[i].dis);
   }
  }
int main()
{
    int n,x[20],y[20],z[20]={0},ju[200],xx[200],yy[200],zz[200]={0},xxx[200],yyy[200],zzz[200]={0};
	int i,j,k=0,m;
	double l[200];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			ju[k]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]);
			l[k]=sqrt(ju[k]);
			xx[k]=x[i];xxx[k]=x[j];yy[k]=y[i];yyy[k]=y[j];zz[k]=z[i];zzz[k]=z[j];
			k++;
		}
	}
	for(i=0;i<k;i++)
	{
		for(j=0;j<k-1;j++)
		{
			if(l[j]<l[j+1])
			{
				double t=l[j+1];l[j+1]=l[j];l[j]=t;
		    m=xx[j+1];xx[j+1]=xx[j];xx[j]=m;
            m=yy[j+1];yy[j+1]=yy[j];yy[j]=m;
			m=zz[j+1];zz[j+1]=zz[j];zz[j]=m;
			m=xxx[j+1];xxx[j+1]=xxx[j];xxx[j]=m;
			m=yyy[j+1];yyy[j+1]=yyy[j];yyy[j]=m;
			m=zzz[j+1];zzz[j+1]=zzz[j];zzz[j]=m;
			}
			else continue;
		}
	}
	for(i=0;i<k;i++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n", xx[i], yy[i], zz[i], xxx[i], yyy[i], zzz[i], l[i]);
	}
	return 0;
}
int main()
{
	int n,i,j,a[80],b[80],k=0,m,code1,code2;
	double S[80],t;
	struct S
	{
	double x;
	double y;
	double z;
	}point[13];
	cin>>n;
	for(i=0;i<n;i++)
		cin>>point[i].x>>point[i].y>>point[i].z;
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)//????Cn2
		{
			S[k]=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));//???
			a[k]=i;b[k]=j;
			k++;//
		}
    for(i=0;i<k;i++)
		for(j=k-1;j>i;j--)//?????
			if(S[j]>S[j-1])
			{
				t=S[j];
				S[j]=S[j-1];
				S[j-1]=t;//????
				m=a[j];
				a[j]=a[j-1];
				a[j-1]=m;//???????
				m=b[j];
				b[j]=b[j-1];
				b[j-1]=m;//???????
			}
    for(i=0;i<k;i++)
	{
		code1=a[i];code2=b[i];
		cout<<"("<<(int)point[code1].x<<","<<(int)point[code1].y<<","<<point[code1].z<<")-("
			<<(int)point[code2].x<<","<<(int)point[code2].y<<","<<point[code2].z<<")=";
		printf("%.2lf",S[i]);
		cout<<endl;
	}
	return 0;
}
int main()
{
	int n, l = 0;
	struct point
	{
		int x;
		int y;
		int z;
	}a[10];
	struct distance
	{
		int m[3];
		int n[3];
		double dis;
	}temp,b[100];
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i].x>>a[i].y>>a[i].z;
	}
	for(int i=0;i<n-1;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			b[l].m[0] = a[i].x;
			b[l].m[1] = a[i].y;
			b[l].m[2] = a[i].z;
			b[l].n[0] = a[j].x;
			b[l].n[1] = a[j].y;
			b[l].n[2] = a[j].z;
			b[l].dis = sqrt( ( a[j].x - a[i].x ) * ( a[j].x - a[i].x ) + ( a[j].y - a[i].y ) * ( a[j].y - a[i].y ) + ( a[j].z - a[i].z ) * ( a[j].z - a[i].z ) );
			l++;
		}
	}
	for(int i=0;i<n*(n-1)/2-1;i++)
	{
		for(int j=0;j<n*(n-1)/2-1;j++)
		{
			if(b[j].dis<b[j+1].dis)
			{
				temp=b[j];
				b[j]=b[j+1];
				b[j+1]=temp;
			}
		}
	}
	for(int i=0;i<n*(n-1)/2;i++)
	{
		cout<<"("<<b[i].m[0]<<","<<b[i].m[1]<<","<<b[i].m[2]<<")-("
			<<b[i].n[0]<<","<<b[i].n[1]<<","<<b[i].n[2]<<")="<<fixed<<setprecision(2)<<b[i].dis<<endl;
	}
	return 0;
}
int fang(int x,int y)
{
    float z;
    z=(x-y)*(x-y);
    return(z);
}
struct dian
{
       int c;
       int d;
       float e;
       }jl[100],tem;
void main()
{
    struct dian ji[100];
    struct dian tem;
    int fang(int x,int y);
    int a[10][3],n,i,j,k=0;
    for(i=0;i<100;i++){
                       jl[i].c=0;
                       jl[i].d=0;
                       jl[i].e=0;
                       }
    scanf("%d",&n);
    for(i=0;i<n;i++){
                     scanf("%d %d %d",&a[i][0],&a[i][1],&a[i][2]);
                     }
    for(i=0;i<n-1;i++){
                     for(j=i+1;j<n;j++){
                                         jl[k].c=i;
                                         jl[k].d=j;
                                         jl[k].e=(float)sqrt(fang(a[i][0],a[j][0])+fang(a[i][1],a[j][1])+fang(a[i][2],a[j][2]));
                                         k++;
                                         }
                     }
    for(j=0;j<k-1;j++){
                       for(i=0;i<k-1-j;i++){
                                            if(jl[i].e<jl[i+1].e){
                                                                  tem=jl[i];
                                                                  jl[i]=jl[i+1];
                                                                  jl[i+1]=tem;
                                                                  }
                                            }
                       }
    for(i=0;;i++){
                  if(jl[i].e==0)
                  break;
                  printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",a[jl[i].c][0],a[jl[i].c][1],a[jl[i].c][2],a[jl[i].d][0],a[jl[i].d][1],a[jl[i].d][2],jl[i].e);
                  }
}