semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    int n,i,e,j=1,k;
    int x[10];
    int y[10];
    int z[10];
    double a[45],m;
    int b[45];
    int c[45];
    scanf("%d",&n);
    for(i=1;i<=n;i++){
    scanf("%d %d %d",&(x[i]),&(y[i]),&(z[i]));
    }
    for(i=1;i<=n-1;i++){
       for(k=i+1;k<=n;k++){
    a[j]=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]));
    b[j]=i;
    c[j]=k;
    j++;}}
    j=j-1;
    for(k=1;k<=j-1;k++){
    for(i=1;i<=j-k;i++){
    if(a[i]<a[i+1]){
    m=a[i];a[i]=a[i+1];a[i+1]=m;
    e=b[i];b[i]=b[i+1];b[i+1]=e;
    e=c[i];c[i]=c[i+1];c[i+1]=e;
    }}}
    for(k=1;k<=j;k++){
    printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[b[k]],y[b[k]],z[b[k]],x[c[k]],y[c[k]],z[c[k]],a[k])
    ;}
    return 0;
}
int main()
{
	int n,i,m,x[100],y[100],z[100],r[100],t[100],a,b,k,c,d,p;
	double q[100],e;
	m=0;
	scanf("%d", &n);
	for(i=0;i<n;i++){
		scanf("%d%d%d", &x[i], &y[i], &z[i]);}
	for(k=0;k<n;k++){
		for(i=k+1;i<n;i++){
			q[m]=sqrt(1.0*(x[i]-x[k])*(x[i]-x[k])+1.0*(y[i]-y[k])*(y[i]-y[k])+1.0*(z[i]-z[k])*(z[i]-z[k]));
			r[m]=k;
			t[m]=i;
			m++;}	
	}
	p=n*(n-1)/2;
	for(a=1;a<p+1;a++){
		for(m=0;m<p-a;m++){
			if(q[m]<q[m+1]){
				e=q[m+1];
				q[m+1]=q[m];
				q[m]=e;
				b=r[m+1];
				r[m+1]=r[m];
				r[m]=b;
				b=t[m+1];
				t[m+1]=t[m];
				t[m]=b;}
		}
	}
	c=0;
	d=0;
	for(m=0;m<p;m++){
		c=r[m];
		d=t[m];
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n", x[c], y[c], z[c], x[d], y[d], z[d], q[m]);}
	return 0;
}
int main() {
	int n;
	int a[10][3];
	int i,j;
	int b[100][2];
	double s[100];
	scanf("%d", &n);
	for(i=0;i<n;i++) {
		scanf("%d%d%d",&(a[i][0]), &(a[i][1]), &(a[i][2]));
	}
	int k=0;
	for(i=0;i<n-1;i++) {
		for(j=i+1;j<n;j++) {
			s[k] = sqrt(pow(a[i][0]-a[j][0],2)+pow(a[i][1]-a[j][1],2)+pow(a[i][2]-a[j][2],2));
			b[k][0] = i;
			b[k][1] = j;
			k++;
		}
	}
	for(i=1; i<k; i++) {
		for(j=0;j<k-i;j++) {
			if(s[j] < s[j+1]) {
				double t=s[j];
				s[j]=s[j+1];
				s[j+1]=t;
				
				int tt=b[j][0];
				b[j][0]=b[j+1][0];
				b[j+1][0]=tt;
				
				tt=b[j][1];
				b[j][1]=b[j+1][1];
				b[j+1][1]=tt;
			}
		}
	}
	for(i=0;i<k;i++) {
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n", a[b[i][0]][0], a[b[i][0]][1], a[b[i][0]][2], a[b[i][1]][0], a[b[i][1]][1], a[b[i][1]][2], s[i]);
	}
				
	return 0;
}
int main()
{
	int n,i,j,k;
	int x,y;
	int a[10][3];
	double b[45][3],temp;
	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,k=0;i<n;i++)
		for(j=i+1;j<n;j++){
			b[k][0]=i;
			b[k][1]=j;
			b[k][2]=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]));
			k++;
		}
	for(i=1;i<k;i++)
		for(j=0;j<k-i;j++){
			if(b[j][2]<b[j+1][2]){
				temp=b[j][0];b[j][0]=b[j+1][0];b[j+1][0]=temp;
				temp=b[j][1];b[j][1]=b[j+1][1];b[j+1][1]=temp;
				temp=b[j][2];b[j][2]=b[j+1][2];b[j+1][2]=temp;
			}
			if(b[j][2]==b[j+1][2]){
				if(b[j][0]>b[j+1][0]){
					temp=b[j][0];b[j][0]=b[j+1][0];b[j+1][0]=temp;
					temp=b[j][1];b[j][1]=b[j+1][1];b[j+1][1]=temp;
					temp=b[j][2];b[j][2]=b[j+1][2];b[j+1][2]=temp;
				}
				if(b[j][0]==b[j+1][0])
					if(b[j][1]>b[j+1][1]){
						temp=b[j][0];b[j][0]=b[j+1][0];b[j+1][0]=temp;
					    temp=b[j][1];b[j][1]=b[j+1][1];b[j+1][1]=temp;
					    temp=b[j][2];b[j][2]=b[j+1][2];b[j+1][2]=temp;
					}
			}
		}
	for(i=0;i<k;i++){
		x=b[i][0];y=b[i][1];
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[x][0],a[x][1],a[x][2],a[y][0],a[y][1],a[y][2],b[i][2]);
	}
    return 0;
}
int main(){
int n;
scanf("%d",&n);
int i,j=0,x[100],y[100],z[100],nlx[100],nly[100],nlz[100],nfx[100],nfy[100],nfz[100];
for(i=0;i<n;i++){
scanf("%d %d %d",&x[i],&y[i],&z[i]);
}
double d,jl[45];
for(i=0;i<n-1;i++){
	for(int k=i+1;k<n;k++){
		d=1.0*(x[i]-x[k])*(x[i]-x[k])+1.0*(y[i]-y[k])*(y[i]-y[k])+1.0*(z[i]-z[k])*(z[i]-z[k]);
			jl[j]=sqrt(d);
			nfx[j]=x[i];
                        nfy[j]=y[i];
                        nfz[j]=z[i];
                        nlx[j]=x[k];
                        nly[j]=y[k];
                        nlz[j]=z[k];
			j++;
		}
		}
int result;
result=n*(n-1)/2;
for(int k=1;k<=result;k++){
double e;
for(j=0;j<result-k;j++){
	if(jl[j]<jl[j+1]){
	e=jl[j+1];
	jl[j+1]=jl[j];
	jl[j]=e;

	e=nfx[j+1];
	nfx[j+1]=nfx[j];
	nfx[j]=e;

	e=nfy[j+1];
	nfy[j+1]=nfy[j];
	nfy[j]=e;

	e=nfz[j+1];
	nfz[j+1]=nfz[j];
	nfz[j]=e;

	e=nlx[j+1];
	nlx[j+1]=nlx[j];
	nlx[j]=e;

	e=nly[j+1];
	nly[j+1]=nly[j];
	nly[j]=e;

	e=nlz[j+1];
	nlz[j+1]=nlz[j];
	nlz[j]=e;
	}
}
}
for(j=0;j<result;j++){
printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",nfx[j],nfy[j],nfz[j],nlx[j],nly[j],nlz[j],jl[j]);
}
return 0;
}
main()
{
	struct B
	{int a;int b;int c;int d;int e;int f;float g;}B[45];
	int n,A[10][3],i,j,p=0,q=0;
	float c[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;i++)
		for(j=i+1;j<n;j++)
		{
			B[p].a=A[i][0];
			B[p].b=A[i][1];
			B[p].c=A[i][2];
			B[p].d=A[j][0];
			B[p].e=A[j][1];
			B[p].f=A[j][2];
			B[p].g=(float)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]));
			p++;
		}
	for(i=0;i<p;i++)
	{
		c[i]=0;
		if(i==0){for(j=0;j<p;j++)if(B[j].g>c[i]) {c[i]=B[j].g;q++;}}
		else
			for(j=0;j<p;j++)
			{
				if(c[i]<B[j].g&&B[j].g<c[i-1])
				{c[i]=B[j].g;q++;}
			}
	}
	int z=0;
	for(i=0;i<q;i++)
		for(j=0;j<p;j++)
		{	if(z==n*(n-1)/2)break;
			if(B[j].g==c[i]) 
			{z++;printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",B[j].a,B[j].b,B[j].c,B[j].d,B[j].e,B[j].f,B[j].g);
			}
		}
}
int main()
{
	int n,i,j,k;
	double x,y,z;
	int a[10][3]={0};;
	double b[45]={0};
	int c[45]={0},d[45]={0};
	cin>> n;
	for(i=0;i<n;i++)
	{
		cin>> a[i][0] >> a[i][1] >> a[i][2];
	}
	k=0;
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			x=y=z=0;
			x=(a[i][0]-a[j][0])*(a[i][0]-a[j][0]);
			y=(a[i][1]-a[j][1])*(a[i][1]-a[j][1]);
			z=(a[i][2]-a[j][2])*(a[i][2]-a[j][2]);
			b[k]=sqrt(x+y+z);c[k]=i;d[k]=j;
			k++;
		}
	}
	for(i=0;i<n*(n-1)/2-1;i++)
	{
		for(j=0;j<n*(n-1)/2-i-1;j++)
		{
			if(b[j]<b[j+1])
				{
					x=b[j];b[j]=b[j+1];b[j+1]=x;
			        k=c[j];c[j]=c[j+1];c[j+1]=k;
				    k=d[j];d[j]=d[j+1];d[j+1]=k;
			}
		}
	}
	for(i=0;i<n*(n-1)/2;i++)
	{
		cout<<"("<<a[c[i]][0]<<","<<a[c[i]][1]<<","<<a[c[i]][2]<<")-("<<a[d[i]][0]<<","<<a[d[i]][1]<<","<<a[d[i]][2]<<")=";
		printf("%.2f",b[i]);cout<<endl;
	}
	return 0;
}
int main()
{
	int n,l=0,a[101],i,j,b[101],c[101],f[50],g[50],x;
	double e[50],y;
	for(i=0;i<50;i++){e[i]=0;}
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d %d %d",&a[i],&b[i],&c[i]);
	}
	for(j=0;j<n-1;j++)
	{
		for(i=j+1;i<n;i++)
		{
			e[l]=sqrt((a[j]-a[i])*(a[j]-a[i])+(b[j]-b[i])*(b[j]-b[i])+(c[j]-c[i])*(c[j]-c[i]));
			f[l]=j;
			g[l]=i;
			l++;
		}
	}
	for(l=0;l<(n*(n-1))/2;l++)
	{
		for(i=0;i<(n*(n-1)/2-1);i++)
		{
			if(e[i]<e[i+1])
			{
				y=e[i];
				e[i]=e[i+1];
				e[i+1]=y;
				x=f[i];
				f[i]=f[i+1];
				f[i+1]=x;
				x=g[i];
				g[i]=g[i+1];
				g[i+1]=x;
			}
		}
	}
	for(l=0;l<n*(n-1)/2;l++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[f[l]],b[f[l]],c[f[l]],a[g[l]],b[g[l]],c[g[l]],e[l]);
	}
   return 0;
}
int main()
{
	int n,j,q;
	scanf("%d",&n);
	struct zb {
		int x,y,z;
	} zb[1000];
	for(q=0;q<n;q++){
		scanf("%d%d%d",&(zb[q].x),&(zb[q].y),&(zb[q].z));
	}
	int i=0;
	struct jl {
		int x1,x2,y1,y2,z1,z2;
		double s;
	} jl[1000];
	for(q=0;q<n-1;q++){
		for(j=q+1;j<n;j++){
			jl[i].x1=zb[q].x;
			jl[i].x2=zb[j].x;
			jl[i].y1=zb[q].y;
			jl[i].y2=zb[j].y;
			jl[i].z1=zb[q].z;
			jl[i].z2=zb[j].z;
			int a,b,c;
			double f;
			a=jl[i].x1-jl[i].x2;
			b=jl[i].y1-jl[i].y2;
			c=jl[i].z1-jl[i].z2;
			f=a*a+b*b+c*c;
			jl[i].s=sqrt(f);
			i++;
		}
	}
	int m;
	m=i;
	for(q=1;q<=m;q++){
		for(j=0;j<m-q;j++){
			if((jl[j+1].s)>(jl[j].s)){
				jl[1000]=jl[j+1];
				jl[j+1]=jl[j];
				jl[j]=jl[1000];
			}
		}
	}
	for(i=0;i<m;i++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",jl[i].x1,jl[i].y1,jl[i].z1,jl[i].x2,jl[i].y2,jl[i].z2,jl[i].s);
	}
	return 0;
}
struct distance
{
	double d;
	int dx;
	int dy;
}dis[100] = {0}, t;
struct point
{
	int x; 
	int y;
	int z;
}poi[10] = {0};
void input(int);
void calculate(int);
void arrange(int);
void output(int);
int main()
{
	int n;
	cin >> n;
	input(n);
	calculate(n);
	arrange(n);
	output(n);
	return 0;
}
void input(int n)
{
	int i;
	for(i = 0; i <
		n; i++)
	{
		cin >> poi[i].x >> poi[i].y >> poi[i].z;
	}
}
void calculate(int n)
{
	int i;
/*	for(i = 0; i < n * n; i++)
	{
		dis[i].d = sqrt((poi[i/n].x - poi[i%n].x) * (poi[i/n].x - poi[i%n].x)+
			            (poi[i/n].y - poi[i%n].y) * (poi[i/n].y - poi[i%n].y)+
                        (poi[i/n].z - poi[i%n].z) * (poi[i/n].z - poi[i%n].z));
		dis[i].dx = i / n;
		dis[i].dy = i % n;
	}
*/
	int x1 = 0, y1 = 1;
	for(i = 0; i < n * (n - 1) / 2; i++)
	{
		dis[i].d = sqrt((poi[x1].x - poi[y1].x) * (poi[x1].x - poi[y1].x) +
			            (poi[x1].y - poi[y1].y) * (poi[x1].y - poi[y1].y) +
						(poi[x1].z - poi[y1].z) * (poi[x1].z - poi[y1].z));
		dis[i].dx = x1;
		dis[i].dy = y1;
		y1++;
		if(y1 == n)
		{
			x1++;
			y1 = x1 + 1;
		}
	}
			       
	return;
}

void arrange(int n)
{
	int i;
	int j;
	for(i = 0; i < n * (n - 1) / 2 - 1; i++)
	{
		for(j = 0; j < n * (n - 1) / 2 - i - 1; j++)
		{
			if(dis[j].d < dis[j + 1].d)
			{
				t = dis[j];
				dis[j] = dis[j + 1];
				dis[j + 1] = t;

			}
		}
	}
	return;
}

void output(int n)
{
	int i;
	for(i = 0; i < n * (n - 1) / 2; i++)  //(0,0,0)-(1,1,1)=1.73
	{
		cout << "(" << poi[dis[i].dx].x << "," << poi[dis[i].dx].y << "," << poi[dis[i].dx].z << ")-("
			 << poi[dis[i].dy].x << "," << poi[dis[i].dy].y << "," << poi[dis[i].dy].z << ")="
			 << setprecision(2) << fixed <<dis[i].d << endl;
	}
	return;
	
	
}
int main(){
	int n,i,p,j,e,k,u;
	double s[50];
	int x[10],y[10],z[10];
	struct result{
           int x1,y1,z1,x2,y2,z2;
           double s;
        }a[50],t;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	}    
	p=(n*(n-1))/2;
	for(i=0;i<n;i++){
		for(j=i+1;j<n;j++){
                        e=(n-1.0*(i+1)/2)*i+j-i-1;
			u=(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[e]=sqrt(1.0*u);
		}
	}
        
        for(i=0;i<n;i++){
            for(j=i+1;j<n;j++){
               e=(n-1.0*(i+1)/2)*i+j-i-1;
               a[e].x1=x[i];
               a[e].y1=y[i];
               a[e].z1=z[i];
               a[e].x2=x[j];
               a[e].y2=y[j];
               a[e].z2=z[j];
               a[e].s=s[e];
           }
        }
        for(k=1;k<=p;k++){
           for(i=0;i<p-k;i++){ 
               if(a[i].s<a[i+1].s){
                   t=a[i+1];
                   a[i+1]=a[i];
                   a[i]=t;
                }
           }
        }
        for(i=0;i<p;i++){       
               printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[i].x1,a[i].y1,a[i].z1,a[i].x2,a[i].y2,a[i].z2,a[i].s);
           
        }
   	return 0;
}
int main(){
int n,m,j,e,x[101],y[101],z[101],a[20000],b[20000];
int s[10000];
int t=0;
double c[10000];
scanf("%d\n",&n);

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(j=i+1;j<n;j++){
s[t]=(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j]);
a[t]=i;b[t]=j;t++;
          }}


for(int i=0;i<t-1;i++){
for(j=0;j<t-i-1;j++){
if(s[j]<s[j+1]){
                  e=s[j+1];  
s[j+1]=s[j]; 
                 s[j]=e;
e=a[j+1];a[j+1]=a[j];a[j]=e;e=b[j+1];b[j+1]=b[j];b[j]=e;
                }
            }}
for(m=0;m<t;m++){
c[m]=1.0*sqrt(s[m]);}
for(m=0;m<t;m++){
       printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[a[m]],y[a[m]],z[a[m]],x[b[m]],y[b[m]],z[b[m]],c[m]);}

return 0;
}
int main() {
    int n,i,h,k,m;
    scanf("%d",&n);
    double dj[30];
    struct dian {
        double x,y,z;
    } d[10];
    struct jl {
        double x1,y1,z1,x2,y2,z2;
        double c;
    } cd[46];
    for(i=0;i<3*n;i++){
        scanf("%lf",&(dj[i]));}
    for(i=0;i<n;i++){
        d[i].x=dj[3*i];
        d[i].y=dj[3*i+1];
        d[i].z=dj[3*i+2];}
    k=0;
    for(i=0;i<n-1;i++){
        for(h=1;h<n-i;h++){
            cd[k].x1=d[i].x;
            cd[k].y1=d[i].y;
            cd[k].z1=d[i].z;
            cd[k].x2=d[i+h].x;
            cd[k].y2=d[i+h].y;
            cd[k].z2=d[i+h].z;
            cd[k].c=sqrt(((cd[k].x1-cd[k].x2)*(cd[k].x1-cd[k].x2)+(cd[k].y1-cd[k].y2)*(cd[k].y1-cd[k].y2)+(cd[k].z1-cd[k].z2)*(cd[k].z1-cd[k].z2)));
            k++;}}
    m=k;
    for(k=1;k<m;k++){
        for(i=0;i<m-k;i++){
            if((cd[i].c)<(cd[i+1].c)){
                cd[45]=cd[i+1];
                cd[i+1]=cd[i];
                cd[i]=cd[45];}}}
    for(i=0;i<m;i++){
        printf("(%.0lf,%.0lf,%.0lf)-(%.0lf,%.0lf,%.0lf)=%.2lf\n",cd[i].x1,cd[i].y1,cd[i].z1,cd[i].x2,cd[i].y2,cd[i].z2,cd[i].c);}
    return 0;}
int main(){
    int n,y;
    scanf("%d\n",&n);
    int x[n][3];
    double jl[10][10],o;
    for(int i=0;i<n;i++){
        scanf("%d%d%d",&x[i][0],&x[i][1],&x[i][2]);
    }
    for(int i=0;i<n-1;i++){
        for(int k=i+1;k<n;k++){
            jl[i][k]=0;
        }
    }
    for(int i=0;i<n-1;i++){
        for(int k=i+1;k<n;k++){
            jl[i][k]=sqrt((x[i][0]-x[k][0])*(x[i][0]-x[k][0])+(x[i][1]-x[k][1])*(x[i][1]-x[k][1])+(x[i][2]-x[k][2])*(x[i][2]-x[k][2]));
        }
    }
    o=0;
    int m,p,q,a=0;
    m=n*(n-1)/2;
    for(int i=0;i<9;i++){
        if(a==m){
            break;
        }
        for(int k=i+1;k<10;k++){
            if(o<jl[i][k]){
                o=jl[i][k];
                p=i;
                q=k;
            }
            if(i==8&&k==9){
                printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[p][0],x[p][1],x[p][2],x[q][0],x[q][1],x[q][2],o);
                jl[p][q]=0;
                i=-1;
                o=0;
                a++;
            }
        }
    }
    return 0;
}
double jl(int ma,int mb,int mc,int md,int me,int mf);
int main(){
	int a[max],b[max];
	int i,k,n,j,h;
	double t,s[max];
	struct dian{
		int x,y,z;
	}d[max];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&(d[i].x),&(d[i].y),&(d[i].z));
	}
	for(k=0,j=0;j<n;j++){
		for(i=j+1;i<n;i++,k++){
		    s[k]=jl(d[i].x,d[i].y,d[i].z,d[j].x,d[j].y,d[j].z);
			a[k]=i;
			b[k]=j;
			}
	}
	for(k=1;k<=n*(n-1)/2;k++){
		for(i=0;i<n*(n-1)/2-k;i++){
			if(s[i+1]>s[i]){
				t=s[i+1];
				s[i+1]=s[i];
				h=a[i];
				a[i]=a[i+1];
				a[i+1]=h;
				s[i]=t;
				j=b[i];
				b[i]=b[i+1];
				b[i+1]=j;


			}
		}
	}
	for(i=0;i<n*(n-1)/2;i++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",d[b[i]].x,d[b[i]].y,d[b[i]].z,d[a[i]].x,d[a[i]].y,d[a[i]].z,s[i]);
	}
	return 0;
}




double jl(int ma,int mb,int mc,int md,int me,int mf){
	double l;
	l=sqrt((double)(ma-md)*(ma-md)+(mb-me)*(mb-me)+(mc-mf)*(mc-mf));
	return l;
}
int main()
{
int n,i,j,a[10000],b[10000],m,x[100],y[100],z[100];
float dis[10000],t;
cin>>n;
for (i=1; i<=n; i++)
	cin>>x[i]>>y[i]>>z[i];
int cnt=0;
for (i=1; i<=n; i++)
	for (j=i+1; j<=n; j++)
	{
		dis[cnt]=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]));
		a[cnt]=i;
		b[cnt]=j;
		cnt=cnt+1;
	}


for (i=0; i<cnt-1; i++)
	for(j=0; j<cnt-1-i; j++)
		if(dis[j]<dis[j+1]){
			t=dis[j];
			dis[j]=dis[j+1];
			dis[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<cnt; i++)
    cout<<fixed<<setprecision(2)<<"("<<x[a[i]]<<","<<y[a[i]]<<","<<z[a[i]]<<")-("<<x[b[i]]<<","<<y[b[i]]<<","<<z[b[i]]<<")="<<dis[i]<<endl;
return 0;
}
int main(){
   int n;
   scanf("%d",&n);
   int *x=(int*)malloc(sizeof(int)*n);
   int *y=(int*)malloc(sizeof(int)*n);
   int *z=(int*)malloc(sizeof(int)*n);
   int i,j;
   for(i=0;i<n;i++){
      scanf("%d%d%d",&x[i],&y[i],&z[i]);
   }
   double *d=(double*)malloc(sizeof(double)*((n-1)*n/2));
   int *number1=(int*)malloc(sizeof(int)*((n-1)*n/2));
   int *number2=(int*)malloc(sizeof(int)*((n-1)*n/2));
   int pos=0; //number1?number2??????? (n-1)*n/2
   for(i=0;i<n-1;i++){	
      for(j=i+1;j<n;j++){         
		 //d[i]=sqrt((x[i]-x[j])^2+(y[i]-y[j])^2+(z[i]-z[j])^2); //~????????
		 d[pos]=sqrt(pow(x[i]-x[j],2)+pow(y[i]-y[j],2)+pow(z[i]-z[j],2));
         number1[pos]=i;
         number2[pos]=j;
		 pos++;
	  }
   }
   int k,f,g;
   double e;
   for(k=1;k<=(n-1)*n/2;k++){
      for(i=0;i<(n-1)*n/2-k;i++){
         if(d[i]<d[i+1]){
		    e=d[i];
            d[i]=d[i+1];
            d[i+1]=e;
            f=number1[i];
            number1[i]=number1[i+1];
            number1[i+1]=f;
            g=number2[i];
            number2[i]=number2[i+1];
            number2[i+1]=g;    
		 }
	  }

   }
   for(k=0;k<(n-1)*n/2;k++){
      printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[number1[k]],y[number1[k]],z[number1[k]],x[number2[k]],y[number2[k]],z[number2[k]],d[k]);
   }
   free(x);
   free(y);
   free(z);
   free(number1);
   free(number2);
   return 0;
}
int main()
{
	int n,i,t,j,m,k;
	float a[10],b[10],c[10];
    float d[10][10];
	int e[10][10];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%f %f %f",&a[i],&b[i],&c[i]);
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
		{
			d[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]));
			e[i][j]=1;
		}
	}
	for(t=1;t<300;t++)
	{
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
		{
			 if(e[i][j]==0)
				 continue;
			 for(m=0;m<n-1;m++)
			 {
				 for(k=m+1;k<n;k++)
				 {
					 if(d[i][j]<d[m][k]&&e[m][k]!=0)
						 break;
				 }
				 if(k<n)
					 break;
			 }
			 if(m==n-1)
			 {
				 printf("(%.0f,%.0f,%.0f)-(%.0f,%.0f,%.0f)=%.2f\n",a[i],b[i],c[i],a[j],b[j],c[j],d[i][j]);
			     e[i][j]=0;
				 break;
			 }
		}
        if(j<n)
			break;
	}
	}
	return 0;
}
int main(){
	int n,m,i,a,b,*sz,*jd,*wd;
	double *d,c; 
	scanf("%d",&n);
    m=0;
	for(i=0;i<n;i++){
		m+=n-1-i;
	}
	sz=(int*)malloc(sizeof(int)*3*n);
	d=(double*)malloc(sizeof(double)*m);
    jd=(int*)malloc(sizeof(int)*m);
	wd=(int*)malloc(sizeof(int)*m);
    for(i=0;i<3*n;i++){
		scanf("%d",&sz[i]);
	}
	i=0;
    for(a=0;a<n;a++){
		for(b=a+1;b<n;b++){
            d[i]=sqrt(1.0*(sz[3*a+0]-sz[3*b+0])*(sz[3*a+0]-sz[3*b+0])+(sz[3*a+1]-sz[3*b+1])*(sz[3*a+1]-sz[3*b+1])+(sz[3*a+2]-sz[3*b+2])*(sz[3*a+2]-sz[3*b+2]));
		    jd[i]=a;
			wd[i]=b;
			i++;
		}
	}
    for(a=1;a<=m;a++){
		for(b=0;b<m-a;b++){
			if(d[b]<d[b+1]){
				c=d[b];
				d[b]=d[b+1];
				d[b+1]=c;
                i=jd[b];
				jd[b]=jd[b+1];
				jd[b+1]=i;
				i=wd[b];
				wd[b]=wd[b+1];
				wd[b+1]=i;
			}
		}
	}
    for(i=0;i<m;i++){
		a=jd[i];
		b=wd[i];
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",sz[3*a+0],sz[3*a+1],sz[3*a+2],sz[3*b+0],sz[3*b+1],sz[3*b+2],d[i]);
	}
	free(sz);
	free(d);
	free(jd);
	free(wd);
	return 0;
}
int main(){
	int n,i,m,j,k,w,p;
	int sz[1000][3],num[10000][2];
	double d[1000],q;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %d %d",&sz[i][0] ,&sz[i][1] ,&sz[i][2]);
	}
m=n*(n-1)/2;
k=0;
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
	d[k]=sqrt((double)((sz[i][0]-sz[j][0])*(sz[i][0]-sz[j][0])+(sz[i][1]-sz[j][1])*(sz[i][1]-sz[j][1])+(sz[i][2]-sz[j][2])*(sz[i][2]-sz[j][2])));
			num[k][0]=i;
			num[k][1]=j;
			k++;
		}
	}
	for(j=1;j<=m;j++){
		for(i=0;i<m-j;i++){
			if(d[i]<d[i+1]){
				q=d[i];d[i]=d[i+1];d[i+1]=q;
				w=num[i][0];
num[i][0]=num[i+1][0];
num[i+1][0]=w;
				p=num[i][1];
num[i][1]=num[i+1][1];
num[i+1][1]=p;
			}
		}
	}
	for(i=0;i<m;i++){
	printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",sz[num[i][0]][0],sz[num[i][0]][1],sz[num[i][0]][2],sz[num[i][1]][0],sz[num[i][1]][1],sz[num[i][1]][2],d[i]);
	}
	return 0;
}
typedef struct _DISTANCE{
    float distance;
    int pointa[3];
    int pointb[3];
} DISTANCE;
int main() {
    int n,i,j,k=0,b,m,point[10][3];
    cin>>n;
    for(i=0;i<n;i++){
          for(j=0;j<3;j++){
                 cin>>point[i][j];
          }                                      
    }
                                      
    DISTANCE test[n*(n-1)/2];

    for ( i = 0; i <n; ++i)
    {
        for(j=i+1;j<n;j++)
        {
          float distance=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]));
             test[k].distance=distance;
             for(m=0;m<3;m++)
             test[k].pointa[m]=point[i][m];
             for(m=0;m<3;m++)
             test[k].pointb[m]=point[j][m];
             k++;
          }
    }
 
        for ( i = 0; i <n*(n-1)/2-1 ; i++)
          {
              for(j = 0; j <n*(n-1)/2-i-1 ; j++) 
              { 
                    if(test[j].distance<test[j+1].distance)
                    {
                         DISTANCE temp=test[j+1];
                          test[j+1]=test[j] ;
                          test[j]=temp;
                    }
              }
          }                                
                                                       
       
      for(k=0;k<n*(n-1)/2;k++) 
     {
         cout<<"("<<test[k].pointa[0]<<","<<test[k].pointa[1]<<"," <<test[k].pointa[2]<<")"<<"-"<<"("<<test[k].pointb[0]<<","<<test[k].pointb[1]<<"," <<test[k].pointb[2]<<")"<<"=";  
         printf("%.2f\n",test[k].distance); 
      }
    
    }
void dx(int x, int y);
void ds(double x, double y);
int main()
{
    int n,i,j,q,p,l,k;
    scanf("%d",&n);
    p=0.5*n*(n-1);
    int x[n],y[n],z[n];
    double o;
    double jl[p];
    int xx[p],yy[p],zz[p],xa[p],ya[p],za[p];
    q=0;
    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++)
        {
            xx[q]=x[i];
            yy[q]=y[i];
            zz[q]=z[i];
            xa[q]=x[j];
            ya[q]=y[j];
            za[q]=z[j];
            jl[q]=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]));
            q++;
        }
    }

    for(i=0;i<p;i++)
    {
        for(j=0;j<p-1;j++)
        {
            if(jl[j]<jl[j+1])
            {
                k=xx[j];
                xx[j]=xx[j+1];
                xx[j+1]=k;
                k=yy[j];
                yy[j]=yy[j+1];
                yy[j+1]=k;    
                k=zz[j];
                zz[j]=zz[j+1];
                zz[j+1]=k;
                k=ya[j];
                ya[j]=ya[j+1];
                ya[j+1]=k;
                k=xa[j];
                xa[j]=xa[j+1];
                xa[j+1]=k;
                k=za[j];
                za[j]=za[j+1];
                za[j+1]=k;
                o=jl[j];
                jl[j]=jl[j+1];
                jl[j+1]=o;
                
            }
            
        }
        
    }
    for(i=0;i<p;i++)
    {printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",xx[i],yy[i],zz[i],xa[i],ya[i],za[i],jl[i]);}
    return 0;
    
}

void dx(int *x, int *y)
{
    int e=0;
    e=*x;
    *x=*y;
    *y=e;
    return;
}
void ds(double *x, double *y)
{
    double r=0;
    r=*x;
    *x=*y;
    *y=r;
    return;
  
    
}
int main()
{
	int n,m,i,j,k=0;
	int q,w;
	int a[10000][4],c[10000],d[10000];
	double b[10000],e;
	scanf("%d",&n);
	m=n*(n-1)/2;
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i][0]);
		scanf("%d",&a[i][1]);
		scanf("%d",&a[i][2]);
	}
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
		{
			b[k]=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]));
			c[k]=i;
			d[k]=j;
			k++;
		}
	}
	for(j=1;j<m;j++)
	{
		for(i=0;i<m-j;i++)
		{
			if(b[i+1]>b[i])
			{
				e=b[i];b[i]=b[i+1];b[i+1]=e;
			    q=c[i];c[i]=c[i+1];c[i+1]=q;
			    w=d[i];d[i]=d[i+1];d[i+1]=w;
			}
		}
	}
	for(i=0;i<m;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[c[i]][0],a[c[i]][1],a[c[i]][2],a[d[i]][0],a[d[i]][1],a[d[i]][2],b[i]);
	return 0;
}