semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	struct 
	{
		double x;
		double y;
		double z;	
	}point[15];
	struct stru
	{
		int p,q;
		double distance;
	}dis[50],temp;
	int n,i,j;
	cin>>n;
	for(i=0;i<n;i++)
		cin>>point[i].x>>point[i].y>>point[i].z;
	int k=0;
	for(i=0;i<n-1;i++)
	   for(j=i+1;j<n;j++)
	   {
			dis[k].p=i;dis[k].q=j;
			double a,b,c;
			a=(point[i].x-point[j].x)*(point[i].x-point[j].x);
			b=(point[i].y-point[j].y)*(point[i].y-point[j].y);
			c=(point[i].z-point[j].z)*(point[i].z-point[j].z);
			dis[k].distance=sqrt(a+b+c);
			k=k+1;
	   }
	for(i=1;i<=k;i++)
	    for(j=0;j<k-i;j++)
	    {
			if(dis[j].distance<dis[j+1].distance)
			{
			    temp=dis[j];dis[j]=dis[j+1];dis[j+1]=temp;
			}
		}
	for(i=0;i<=k-1;i++)
	{
	    cout<<'('<<point[dis[i].p].x<<','<<point[dis[i].p].y<<','<<point[dis[i].p].z<<')';
	    cout<<"-("<<point[dis[i].q].x<<','<<point[dis[i].q].y<<','<<point[dis[i].q].z<<")=";
		printf("%.2f\n",dis[i].distance);
	}
	return 0;
}
int main()
{
	int n, i, j, k, l, m, a, b;
	int x[12] = {0};
	int y[12] = {0};
	int z[12] = {0};
	double d[12][12] = {0};
	double max;
	int pm[12][12] = {0};
	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++)
		{
			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]));
		}
	}
	max = -1.0;
	k = n * (n - 1) / 2;
	for (l = 1; l <= k; l++)
	{
		for (i = 1; i <= n; i++)
		{
			for (j = i + 1; j <= n; j++)
			{
				if (d[i][j] - max > 1e-10)
				{
					max = d[i][j];
					a = i;
					b = j;
				}
			}
		}
		cout << "(" << x[a] << "," << y[a] << "," << z[a] << ")" << "-" << "(" << x[b] << "," << y[b] << "," << z[b] << ")" << "=" << fixed << setprecision(2) << d[a][b] << endl;
		d[a][b] = 0;
		max = - 1;
	}
	return 0;
}
struct DOT
{
       int x,y,z;
}dot[10],temp;
int main()
{
    int i,n,j,t,p,q;
    double d[10][10]={0},max;
    scanf("%d",&n);
    for(i=0;i<n;i++){
                     scanf("%d%d%d",&dot[i].x,&dot[i].y,&dot[i].z);
                     }//printf("%d %d %d\n",dot[0].x,dot[0].y,dot[0].z);
    for(i=0;i<n-1;i++){
                       for(j=i+1;j<n;j++){

                                          d[i][j]=sqrt((dot[i].x-dot[j].x)*(dot[i].x-dot[j].x)+(dot[i].y-dot[j].y)*(dot[i].y-dot[j].y)+(dot[i].z-dot[j].z)*(dot[i].z-dot[j].z));
                                          }
                                          } 
    for(t=0;t<n*(n-1)/2;t++){max=d[0][0];
    for(i=0;i<n;i++){
                     for(j=0;j<n;j++){
                                      if(d[i][j]>max) {max=d[i][j];p=i;q=j;}
                                      }
                                      }//printf("%.2f",max);
    printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",dot[p].x,dot[p].y,dot[p].z,dot[q].x,dot[q].y,dot[q].z,max);
    d[p][q]=0;}
    return 0;
}
struct dis
	{
		int place_p1;
		int p1[3];
		int place_p2;
		int p2[3];
		float distance;
	}p[45];
void main()
{
void exchange(struct dis *pa,struct dis *pb);

	int n,i,j,point[10][3],count=0;
    struct dis *po=p;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d%d%d",&point[i][0],&point[i][1],&point[i][2]);
	



    for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
		{
			po->place_p1=i;
            po->p1[0]=point[i][0];
            po->p1[1]=point[i][1];
			po->p1[2]=point[i][2];
			po->place_p2=j;
			po->p2[0]=point[j][0];
			po->p2[1]=point[j][1];
			po->p2[2]=point[j][2];
			float d1,d2,d3;
			d1=(float)point[i][0]-point[j][0];
            d2=(float)point[i][1]-point[j][1];
            d3=(float)point[i][2]-point[j][2];
			po->distance=sqrt(d1*d1+d2*d2+d3*d3);
			po++;
		}
	


	for(i=0;i<n*(n-1)/2;i++)
		for(j=0;j<n*(n-1)/2;j++)
			if(p[j].distance<p[j+1].distance)
				exchange(&p[j],&p[j+1]);

	for(i=0,po=p;i<n*(n-1)/2;i++,po++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",po->p1[0],po->p1[1],po->p1[2],po->p2[0],po->p2[1],po->p2[2],po->distance);
}



void exchange(struct dis *pa,struct dis *pb)
{
	float temp;int i;
	int t;
	t=pa->place_p1;pa->place_p1=pb->place_p1;pb->place_p1=t;
	t=pa->place_p2;pa->place_p2=pb->place_p2;pb->place_p2=t;
	for(i=0;i<3;i++)
	{
		t=pa->p1[i];pa->p1[i]=pb->p1[i];pb->p1[i]=t;
		t=pa->p2[i];pa->p2[i]=pb->p2[i];pb->p2[i]=t;
	}

	temp=pa->distance;
	pa->distance=pb->distance;
	pb->distance=temp;
}
//**********************************
//****       ??????      *****
//****        1200012718       *****
//**        ???????        **
//**********************************
int main()
{
	int n;
	cin>>n;       //????n
	int x[11]={0},y[11]={0},z[11]={0};    //??????xyz?????????????
	double x1[11]={0},y1[11]={0},z1[11]={0};    //?????
	double d[46]={0};      //d??????10????45???
	int begin[46]={0},end[46]={0};  //??????????????
	for (int i=1;i<=n;i++)
	{
		cin>>x[i]>>y[i]>>z[i];
		x1[i]=x[i];
		y1[i]=y[i];
		z1[i]=z[i];
	}     //??????????
	int k=1;   //???k?????d??????????
	for (int i=1;i<=n;i++)
		for (int j=i+1;j<=n;j++)
		{
			d[k]=sqrt((x1[i]-x1[j])*(x1[i]-x1[j])+(y1[i]-y1[j])*(y1[i]-y1[j])+(z1[i]-z1[j])*(z1[i]-z1[j]));
			begin[k]=i;
			end[k]=j;
			k++;
		}            //???????begin end??????
		for (int i=1;i<=n*(n-1)/2-1;i++)   //????
			for (int j=1;j<=n*(n-1)/2-i;j++)
			{
				if (d[j]<d[j+1])
				{
					double m=d[j];
					d[j]=d[j+1];
					d[j+1]=m;           //??????????????????????
					int t=begin[j];
					begin[j]=begin[j+1];
					begin[j+1]=t;
					t=end[j];
					end[j]=end[j+1];
					end[j+1]=t;
				}
			}
			for(int i=1;i<=n*(n-1)/2;i++)
			{
				cout<<"("<<x[begin[i]]<<","<<y[begin[i]]<<","<<z[begin[i]]<<")-("<<x[end[i]]<<","<<y[end[i]]<<","<<z[end[i]]<<")=";
				printf("%.2f\n",d[i]);//?????
			}
	
			return 0;
}
//****************************************
//*????                   **
//*??? 1100012927              **
//*2011.11.29                     **
//****************************************

int main()
{
	int n, i, j, k, z = 0;
	double dis[50][7], zb[10][3], temp;
    double (*p)[7];
    p = dis;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> zb[i][0] >> zb[i][1] >> zb[i][2];
	}
	for (i = 0; i < n - 1; i++)
		for (j = i + 1; j < n; j++)
		{
			for (k = 0; k < 3; k++)
			{
				*(*(p + z) + k) = zb[i][k];
				*(*(p + z) + k + 3) = zb[j][k];
			}
			*(*(p + z) + 6) = sqrt(pow((*(*(p + z) + 0) - *(*(p + z) + 3)), 2) + pow((*(*(p + z) + 1) - *(*(p + z) + 4)), 2) + pow((*(*(p + z) + 2)- *(*(p + z) + 5)), 2));
			z++;
		}
    for (i = 0; i < z - 1; i++)
        for (j = 0; j < z - i - 1; j++)
        {
            if (fabs(*(*(p + j) + 6) - *(*(p + j + 1) + 6)) < 1e-3)
				continue;
            else if (*(*(p + j) + 6) < *(*(p + j + 1) + 6))
            {
                for (k = 0; k < 7; k++)
                {
                    temp = *(*(p + j) + k); *(*(p + j) + k) = *(*(p + j + 1) + k); *(*(p + j + 1) + k) = temp;
                }
            }
        }
    for (i = 0; i < n * (n - 1) / 2; i++)
    {
        cout << fixed;
        cout <<setprecision(0)<< "(" << *(*(p + i) + 0) <<","<< *(*(p + i) + 1) <<"," << *(*(p + i) + 2) <<")-("<< *(*(p + i) + 3) <<","<<*(*(p + i) + 4)<<","<<*(*(p + i) + 5)<<")=";
        cout << setprecision(2) << *(*(p + i) + 6)<<endl;
    }
    
	return 0;
}
int main(){
    int i,j,k,m,n;
    double e;
    scanf("%d",&n);
    int sz[10][3];
    for(i=0;i<n;i++){
        for(j=0;j<3;j++){
            scanf("%d",&sz[i][j]);
        }
    }
    double s[50];
    m=0;
    double zong;
    int a[50][3];
     int b[50][3];
    for(j=0;j<(n-1);j++){
        for(i=j+1;i<=n-1;i++){
            zong=0;
            for(k=0;k<3;k++){
                a[m][k]=sz[j][k];
                b[m][k]=sz[i][k];
                zong+=pow((a[m][k]-b[m][k]),2);
            }
            s[m]=sqrt(zong);
            m++;
        }       
    }
    for(j=0;j<m-1;j++){
        for(i=0;i<m-1-j;i++){
            if(s[i]<s[i+1]){
               e=s[i];
               s[i]=s[i+1];
               s[i+1]=e;
               for(k=0;k<3;k++){
                   e=a[i][k];
                   a[i][k]=a[i+1][k];
                   a[i+1][k]=e;
                   e=b[i][k];
                   b[i][k]=b[i+1][k];
                   b[i+1][k]=e;
               }
            }
        }
    }
    for(i=0;i<m;i++){
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i][0],a[i][1],a[i][2],b[i][0],b[i][1],b[i][2],s[i]);
    }
    return 0;
}
int main()
{
	struct distance
	{
		int x;
		int y;
		double l;
	};
	struct distance d[100];
	int n,i,k,mount,tx,ty,j;
	int a[11][4];
	double s[11][11];
	double t,tl;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{
		scanf("%d%d%d",&a[i][1],&a[i][2],&a[i][3]);
	}
	k=1;
	for(i=1;i<n;i++)
	{
		for(j=i+1;j<=n;j++)
		{
			t=(double)((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]));
			s[i][j]=sqrt(t);
			d[k].l=s[i][j];
			d[k].x=i;
			d[k].y=j;
			k++;
		}
	}
	mount=n*(n-1)/2;
	if(mount>=2)
	{
	for(i=1;i<=mount-1;i++)
	{
		for(j=mount-1;j>=i;j--)
		{
			if(d[j].l<d[j+1].l)
			{
				tx=d[j].x;
				ty=d[j].y;
				tl=d[j].l;
				d[j].x=d[j+1].x;
				d[j].y=d[j+1].y;
				d[j].l=d[j+1].l;
				d[j+1].x=tx;
				d[j+1].y=ty;
				d[j+1].l=tl;
			}
		}
	}
	}
	for(i=1;i<=mount;i++)
	{
		tx=d[i].x;
		ty=d[i].y;
		tl=d[i].l;
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[tx][1],a[tx][2],a[tx][3],a[ty][1],a[ty][2],a[ty][3],tl);
	}
	return 0;
}
int main ()
{
	int n;
	int a[10][3];
	double d[45][3];           
	int i=0;
	double change;
	cin>>n;
	for (int t=0;t<n;++t)
		cin>>a[t][0]>>a[t][1]>>a[t][2];
	for (int t1=0;t1<n;++t1)
		for (int t2=t1+1;t2<n;++t2)
		{
			d[i][0]=t1;
			d[i][1]=t2;
			d[i][2]=sqrt( (a[t1][0]-a[t2][0])*(a[t1][0]-a[t2][0]) +
					(a[t1][1]-a[t2][1])*(a[t1][1]-a[t2][1]) + (a[t1][2]-a[t2][2])*(a[t1][2]-a[t2][2]) );
			++i;               
		}
	for (int t1=0;t1<i-1;++t1)        
		for (int t2=0;t2<i-1-t1;++t2)
			if (d[t2][2]<d[t2+1][2])
			{
				change=d[t2][2];
				d[t2][2]=d[t2+1][2];
				d[t2+1][2]=change;

				change=d[t2][0];
				d[t2][0]=d[t2+1][0];
				d[t2+1][0]=change;

				change=d[t2][1];
				d[t2][1]=d[t2+1][1];
				d[t2+1][1]=change;
			}
	for (int t=0;t<i;++t)
		printf ("(%d,%d,%d)-(%d,%d,%d)=%0.2lf\n",a[(int) d[t][0]][0],a[(int) d[t][0]][1],
				a[(int) d[t][0]][2],a[(int) d[t][1]][0],a[(int) d[t][1]][1],a[(int) d[t][1]][2],d[t][2]);
	return 0;
}
int main()
{
    int x[11],y[11],z[11],g=0,e1,e2;
    double d[11][11],m;
    int max[45][2];
    int i,j,k,n,e,a,s;
    scanf("%d",&n);
    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=0;j<n;j++){
            d[i][j]=0;
            }
        }
    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]));
            g=g+1;
            }
        } 
    for(k=0;k<g;k++){
        max[k][0]=0;
        max[k][1]=0;
        }
    for(k=0;k<g;k++){
        s=k+1;
        for(a=0;a<n;a++){
            s=s-n+a+1;
            if(s<=0){
               s=s+n-a-1;
               break;}
            }
        max[k][0]=a;
        max[k][1]=s+a;
        }
    for(k=0;k<g;k++){
        for(e=g-1;e>=k;e--){
            if(e<g-1){
                 if(d[max[e][0]][max[e][1]]<d[max[e+1][0]][max[e+1][1]]){
                    e1=max[e][0];
                    max[e][0]=max[e+1][0];
                    max[e+1][0]=e1;
                    e2=max[e][1];
                    max[e][1]=max[e+1][1];
                    max[e+1][1]=e2;
                 }
               }
            }
        } 
    for(k=0;k<g;k++){
        printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[max[k][0]],y[max[k][0]],z[max[k][0]],x[max[k][1]],y[max[k][1]],z[max[k][1]],d[max[k][0]][max[k][1]]);
        }             
    return 0;
}
int main()
{
	int n,m=0;
	int i=0,j=0;
	int a=0,b=0;
	double i1=0;
	int i2=0,i3=0,i4=0,i5=0;
	double x[10],y[10],z[10],distance[100];
	int p[100],q[100],p1[100],q1[100];
	cin>>n;
	for(m=0;m<n;m++)
		cin>>x[m]>>y[m]>>z[m];
	for(i=0;i<100;i++)
	{
		p[i]=0;
		q[i]=0;
	}
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
			{
				distance[b]=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]));
			    p[b]=i;
			    q[b]=j;
			    //cout<<p[b]<<q[b];
			    b++;
		}
	}
	i4=0;
	i5=0;
	for(i4=0;i4<n*(n-1)/2-1;i4++)
	{
		for(i5=i4+1;i5<n*(n-1)/2;i5++)
		{
			if(distance[i5]>distance[i4])
			{
				i1=distance[i4];
				distance[i4]=distance[i5];
				distance[i5]=i1;
				i2=p[i4];
				p[i4]=p[i5];
				p[i5]=i2;
				i3=q[i4];
				q[i4]=q[i5];
				q[i5]=i3;
}
				
		}
	}
	i=0;
	for(i=0;i<n*(n-1)/2;i++)
	{
		if(distance[i]==distance[i+1])
		{
			if(p[i]>p[i+1])
			{
				i2=p[i+1];
				p[i+1]=p[i];
				p[i]=i2;
				i3=q[i+1];
				q[i+1]=q[i];
				q[i]=i3;
			}
			if(p[i]==p[i+1]&&q[i]>q[i+1])
			{
				i2=p[i+1];
				p[i+1]=p[i];
				p[i]=i2;
				i3=q[i+1];
				q[i+1]=q[i];
				q[i]=i3;
			}
		}
	}
	for(i=0;i<n*(n-1)/2;i++)
	{
		cout<<"("<<x[p[i]]<<","<<y[p[i]]<<","<<z[p[i]]<<")"<<"-("<<x[q[i]]<<","<<y[q[i]]<<","<<z[q[i]]<<")=";
		printf("%.2lf\n",distance[i]);
	}
	return 0;
}
int main()
{
    int a[110][3],n,k,i,j,s=0,flag[1000][2],temp2;
    float b[110],temp1;
    double m=0;
    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;i++)
      for(k=i+1;k<n;k++)
      {
        m=0;
        for(j=0;j<3;j++)
          m+=(a[k][j]-a[i][j])*(a[k][j]-a[i][j]);
        b[s]=sqrt(m);
        flag[s][0]=i;
        flag[s][1]=k;
        s++;
      }
    for(j=0;j<s-1;j++)
      for(i=0;i<s-j-1;i++)
        if(b[i]<b[i+1])
        {
          temp1=b[i];
          b[i]=b[i+1];
          b[i+1]=temp1;
          for(k=0;k<2;k++)
          {
            temp2=flag[i][k];
            flag[i][k]=flag[i+1][k];
            flag[i+1][k]=temp2;
          }
        }
     for(i=0;i<s;i++)
       printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",a[flag[i][0]][0],a[flag[i][0]][1],a[flag[i][0]][2],a[flag[i][1]][0],a[flag[i][1]][1],a[flag[i][1]][2],b[i]);     
     return 0;
}
int main(){
	int n,m,t,i,j,x[15],y[15],z[15];
	double s[150],k;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	}
	t=0;
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			s[t]=sqrt((1.0)*((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j])));
			t++;
		}
	}
	for(i=1;i<=t-1;i++){
		for(j=0;j<t-i;j++){
			if(s[j]<s[j+1]){
				k=s[j];
				s[j]=s[j+1];
				s[j+1]=k;
			}
		}
	}
	for(m=0;m<t;m++){
		if(s[m]==s[m+1]){
			continue;
		}else{
		for(i=0;i<n-1;i++){
			for(j=i+1;j<n;j++){
				if(s[m]==sqrt((1.0)*(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]))){
					printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[i],y[i],z[i],x[j],y[j],z[j],s[m]);
				}
			}
		}
	}
	}
	return 0;
}
int main()
{
    int n,a[10],b[10],c[10],i,j,x,m=0;
    double sun[10][10],s[50],k;
    scanf("%d",&n);
    for(i=0;i<n;i++){
scanf("%d %d %d",&a[i],&b[i],&c[i]);
    }
    for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
    sun[i][j]=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=0;i<n;i++){
for(j=i+1;j<n;j++){
s[m]=sun[i][j];
m++;
}
    }
    for(i=0;i<m;i++){
for(j=i+1;j<m;j++){
    if(s[j]>s[i]){
k=s[i];
                s[i]=s[j];
        s[j]=k;
    }
}
    }
    for(i=0;i<m;i++){
if(s[i]==s[i+1]){
    for(j=i+1;j<m;j++){
s[j]=s[j+1];
i=i-1;
m=m-1;
    }
}
    }
    for(x=0;x<m;x++){
for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
if(s[x]==sun[i][j]){
    printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i],b[i],c[i],a[j],b[j],c[j],sun[i][j]);
}
    }
}
    }
    return 0;
}
struct point{
	int x;
	int y;
	int z;
}point[10];
struct jl{
	int c;
	int d;
	float f;
}jl[45];
int main()
{
    int n,i,j;
	struct jl t;
	float juli(struct point a,struct point b);
	scanf("%d",&n);
    for(i=0;i<n;i++)
		scanf("%d%d%d",&point[i].x,&point[i].y,&point[i].z);
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++){
			jl[n*i-i*(i+1)/2+j-i-1].f=juli(point[i],point[j]);
			jl[n*i-i*(i+1)/2+j-i-1].c=i;
			jl[n*i-i*(i+1)/2+j-i-1].d=j;
		}
	for(j=1;j<n*(n-1)/2;j++)
		for(i=0;i<n*(n-1)/2-j;i++)
			if(jl[i].f<jl[i+1].f){
				t=jl[i];
				jl[i]=jl[i+1];
				jl[i+1]=t;
			}
	for(i=0;i<n*(n-1)/2;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",point[jl[i].c].x,point[jl[i].c].y,point[jl[i].c].z,point[jl[i].d].x,point[jl[i].d].y,point[jl[i].d].z,jl[i].f);
	return 0;
}
float juli(struct point a,struct point b)
{
	float k;
	k=sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y)+(a.z-b.z)*(a.z-b.z));
	return k;
}
int main(){
	int n,h[10],z[10],s[10],a[100],b[100],c[100],d[100],e[100],f[100],i,j,l,m,o,q,r,t,k;
	double g[100],p;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&h[i],&z[i],&s[i]);
	}
	k=0;
	for(i=0;i<n;i++){
		for(j=i+1;j<n;j++){
			g[k]=pow((h[i]-h[j])*(h[i]-h[j])+(z[i]-z[j])*(z[i]-z[j])+(s[i]-s[j])*(s[i]-s[j]),0.5);
			a[k]=h[i];
			b[k]=z[i];
			c[k]=s[i];
			d[k]=h[j];
			e[k]=z[j];
			f[k]=s[j];
			k++;
		}
	}
	for(k=0;k<n*(n-1)/2;k++){
		for(i=0;i<n*(n-1)/2-k;i++){
			if(g[i]<g[i+1]){
				p=g[i];
				g[i]=g[i+1];
				g[i+1]=p;
				l=a[i];
				a[i]=a[i+1];
				a[i+1]=l;
				m=b[i];
				b[i]=b[i+1];
				b[i+1]=m;
				o=c[i];
				c[i]=c[i+1];
				c[i+1]=o;
				q=d[i];
				d[i]=d[i+1];
				d[i+1]=q;
				r=e[i];
				e[i]=e[i+1];
				e[i+1]=r;
				t=f[i];
				f[i]=f[i+1];
				f[i+1]=t;
			}
		}
	}
	for(i=0;i<n*(n-1)/2;i++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i],b[i],c[i],d[i],e[i],f[i],g[i]);
	}
	return 0;
}
int main()
{
	int n,j,t,a,b,r=0,x[10],y[10],z[10];
	double e,sz[45][3];
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	}
    for(j=0;j<n-1;j++){
		for(t=j+1;t<n;t++){
			sz[r][0]=j;
			sz[r][1]=t;
			sz[r][2]=sqrt((x[j]-x[t])*(x[j]-x[t])+(y[j]-y[t])*(y[j]-y[t])+(z[j]-z[t])*(z[j]-z[t]));
			r++;
		}
	}
	for(j=1;j<=r;j++){
		for(t=0;t<r-j;t++){
			if(sz[t][2]<sz[t+1][2]){
				e=sz[t][2];
				sz[t][2]=sz[t+1][2];
				sz[t+1][2]=e;
				e=sz[t][0];
				sz[t][0]=sz[t+1][0];
				sz[t+1][0]=e;
				e=sz[t][1];
				sz[t][1]=sz[t+1][1];
				sz[t+1][1]=e;
			}
		}
	}
	for(j=0;j<r;j++){
		int a=sz[j][0];
		int b=sz[j][1];
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[a],y[a],z[a],x[b],y[b],z[b],sz[j][2]);
	}
	return 0;
}
int main()
{
int n,x[20],y[20],z[20],i,j,q,w,k;
double dis[20][20]={0},max;
scanf("%d",&n);
for (i=1;i<=n;i++) scanf("%d %d %d",&x[i],&y[i],&z[i]);
    for (i=1;i<n;i++)
for (j=i+1;j<=n;j++)
dis[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 (i=1;i<=((n*(n-1))/2);i++){
 max=0;
  for (j=1;j<n;j++)
  for (k=j+1;k<=n;k++)
  if (dis[j][k]>max){
   max=dis[j][k];
   q=j;
   w=k;
  }
printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[q],y[q],z[q],x[w],y[w],z[w],dis[q][w]);
dis[q][w]=0;
}
return 0;
}
int main(){
    int n,i,j,m,k=0,x[10],y[10],z[10],a[50],b[50];
    double d[50],e;
    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++){
            a[k]=i;
            b[k]=j;
            d[k]=sqrt(1.0*(x[i]-x[j])*(x[i]-x[j])+1.0*(y[i]-y[j])*(y[i]-y[j])+1.0*(z[i]-z[j])*(z[i]-z[j]));
            k++;
        }
    }
    for(i=k;i>0;i--){
          for(j=k-1;j>0;j--){
            if(d[j]>d[j-1]){
                e=d[j];
                d[j]=d[j-1];
                d[j-1]=e;
                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++){
        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]],d[i]);
    }
    return 0;
}
int main() {
    struct dot1 {
        int x;
        int y;
        int z;
    } dot[10];
    float dis[10][10]={0,0};
    float distance; 
    int row, col, sign=0;
    int n, i, j;
    scanf("%d", &n);
    for (i=0;i<n;i++) {
        scanf("%d%d%d", &dot[i].x, &dot[i].y, &dot[i].z);
    }
    for (i=0;i<n;i++) {
        for(j=i+1;j<n;j++) {
            dis[i][j]=(float)(dot[i].x-dot[j].x)*(float)(dot[i].x-dot[j].x)+(float)(dot[i].y-dot[j].y)*(float)(dot[i].y-dot[j].y)+(float)(dot[i].z-dot[j].z)*(float)(dot[i].z-dot[j].z);
            dis[i][j]=sqrt((float)dis[i][j]);
        }
    }
    do {
        distance=dis[0][1];
        row=0;
        col=1;
    for(i=0;i<n;i++) {
        for (j=i+1;j<n;j++) {
            if (distance<dis[i][j]) {
                distance=dis[i][j];
                row=i;
                col=j;
            }
        }
    }
    printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n", dot[row].x, dot[row].y, dot[row].z, dot[col].x, dot[col].y, dot[col].z, distance);
    dis[row][col]=0;
        sign+=1;
    } while(sign!=(n-1)*n/2);
    return 0;
}
int main(){

	int n=0;

	cin>>n;

	int dis[10][3];

	float ans[1000][7];

	for(int i=0;i<n;i++){
		for(int j=0;j<3;j++){
			cin>>dis[i][j];
			
		}
	}

	int num=0;

	for(int i=0;i<n-1;i++){
		for(int j=i+1;j<n;j++){
			
			for(int k=0;k<3;k++){
				ans[num][k]=dis[i][k];
			}
			for(int k=0;k<3;k++){
				ans[num][k+3]=dis[j][k];
				
			}
				ans[num][6]=0.0;
			for(int k=0;k<3;k++){
				ans[num][6]+=(dis[i][k]-dis[j][k])*(dis[i][k]-dis[j][k]);
			}

			ans[num][6]=sqrt(ans[num][6]);

			num++;
		}
	}

	for(int i=0;i<num;i++){
		for(int j=num-1;j>i;j--){
			if(ans[j][6]>ans[j-1][6]){
				
				for(int k=0;k<7;k++){
					float tmp=ans[j][k];
					ans[j][k]=ans[j-1][k];
					ans[j-1][k]=tmp;

				}
			}
		}
	}

	for(int i=0;i<num;i++){
		cout<<'('<<ans[i][0]<<','<<ans[i][1]<<','<<ans[i][2]<<")-("<<ans[i][3]<<','<<ans[i][4]<<','<<ans[i][5]<<")=";
		printf("%.2f",ans[i][6]);
		if(i<num-1) cout<<endl;
	}

	
	return 0;


	
}
int main()
{ 
  int a[100],b[100],x[20],y[20],z[20];
  double h[100];
  double q;
  int i,j,k,n,t,p;
  cin >>n;
  for (i=1;i<=n;i++)
       cin >>x[i]>>y[i]>>z[i];
  t=0;
  for (i=1;i<n;i++)
       for (j=i;j<=n;j++) 
            if (i!=j)
                { t++;
                  a[t]=i;
                  b[t]=j;
                  h[t]=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 (i=1;i<=t;i++)
       for (j=1;j<t;j++)
            { if (h[j]<h[j+1])
                  {q=h[j];
                   h[j]=h[j+1];
                   h[j+1]=q;
                   p=a[j];
                   a[j]=a[j+1];
                   a[j+1]=p;
                   p=b[j];
                   b[j]=b[j+1];
                   b[j+1]=p;  }
              
            }
  for (i=1;i<=t;i++)
       { cout<<"("<<x[a[i]]<<","<<y[a[i]]<<","<<z[a[i]]<<")-("<<x[b[i]]<<","<<y[b[i]]<<","<<z[b[i]]<<")=";
         printf("%.2f",h[i]);
         cout<<endl;
         }
  return 0;
}
int main()
{
	int n;
	scanf("%d",&n);
	double x[150],y[150],z[150];
	int i;
	for(i=1;i<=n;i++)
	{
		scanf("%lf",&x[i]);
		scanf("%lf",&y[i]);
		scanf("%lf",&z[i]);
	}
	int j,h;
	h=1;
	double sum;
	double s1[150][150];
	double a[10000];
	for(i=1;i<n;i++)
	{
		for(j=i+1;j<=n;j++)
		{
			sum=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]);
			s1[i][j]=sqrt(sum);
			a[h]=s1[i][j];
			h++;
		}
	}
	h--;
	int k;
	double e;
	for(k=1;k<h;k++)
	{
		for(i=1;i<=h-k;i++)
		{
			if(a[i]<a[i+1])
			{
				e=a[i];
				a[i]=a[i+1];
				a[i+1]=e;
			}
		}
	}
	int count=2;
	double b[10000];
	b[1]=a[1];
	for(i=2;i<=h;i++)
	{
		if(a[i]!=a[i-1])
		{
			b[count]=a[i];
			count++;
		}
	}
	count--;
	for(k=1;k<=count;k++)
	{
		for(i=1;i<n;i++)
		{
			for(j=i+1;j<=n;j++)
			{
				if(s1[i][j]==b[k])
					printf("(%.0lf,%.0lf,%.0lf)-(%.0lf,%.0lf,%.0lf)=%.2lf\n",x[i],y[i],z[i],x[j],y[j],z[j],b[k]);
			}
		}
	}
	return 0;
}
int main(){
	int n,i;
	scanf("%d",&n);
	int sz[30];
	for(i=0;i<(3*n);i++){
		scanf("%d",&sz[i]);
	}

	double dd[10][10];
	int j,k;
	for(i=0;i<n;i++){
		for(j=0;j<n;j++){
			dd[i][j]=sqrt(1.0*((sz[3*i]-sz[3*j])*(sz[3*i]-sz[3*j])+(sz[3*i+1]-sz[3*j+1])*(sz[3*i+1]-sz[3*j+1])+(sz[3*i+2]-sz[3*j+2])*(sz[3*i+2]-sz[3*j+2])));
		}
	}
	
	double xin[45];
	int d,e;
	int di[45],dj[45];
	double max=0;
	for(k=0;k<n*(n-1)/2;k++){
		
		for(i=n-1;i>=0;i--){
			
			for(j=n-1;j>=0;j--){
				
				if(dd[i][j]>=max&&k==0&&i!=j){
					di[k]=i;
					dj[k]=j;
					max=dd[i][j];
				
				}
				
				if(dd[i][j]>=max&&k!=0&&i!=j){
					di[k]=i;
					dj[k]=j;
					max=dd[i][j];
				
				}		
			}
		}
		dd[di[k]][dj[k]]=-1;
		dd[dj[k]][di[k]]=-1;
		xin[k]=max;
		max=0;
	}

	for(i=0;i<n*(n-1)/2;i++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",sz[3*di[i]],sz[3*di[i]+1],sz[3*di[i]+2],sz[3*dj[i]],sz[3*dj[i]+1],sz[3*dj[i]+2],xin[i]);
	}
	return 0;
}