semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int n;
	double x[11], y[11], z[11], s[11][11];
	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++)
		{
			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]);
			s[i][j] = sqrt(s[i][j]);
		}
	}

	for(int k = 1; k <= n * (n-1) / 2; k++)
	{
		double max = 0;
		int t1 = 0, t2 = 0;
		for(int i = 1; i <= n; i++)
		{
			for(int j = i + 1; j <= n; j++)
			{
				if(s[i][j] > max )
				{
//					cout << i<<"   "<<j<<"  :  "<<s[i][j] << " &   "<<max <<endl;
					max = s[i][j];
					t1 = i;
					t2 = j;
				}
			}
		}
		cout << "(" << x[t1] << "," << y[t1] << "," << z[t1] << ")-(" << x[t2] << "," << y[t2] << "," << z[t2] << ")=" ;
		printf( "%.2lf\n", s[t1][t2]);
		s[t1][t2] = 0;

	}
	return 0;
}
int main(){
	int x[10],y[10],z[10],n,num=0;//????x,y,z?num????? 
	double a[10][10],b[45];//??????????????????????????????????????? 
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>x[i]>>y[i]>>z[i];
		}//???????? 
		for(int i=0;i<n;i++){
			for(int j=i+1;j<n;j++){
				a[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]));
				b[num]=a[i][j];
				num++;
				}//????????????????????? 
			}	
			double p;
			for(int i=0;i<num-1;i++){
				for(int j=0;j<num-1-i;j++){
					if(b[j]<b[j+1]){
						p=b[j];
						b[j]=b[j+1];
						b[j+1]=p;
						}
					}
				}//????????????? 
				for(int k=0;k<num;k++){
					if(b[k]==b[k+1])continue;//?????????????????? 
					else {
						for(int i=0;i<n;i++){
							for(int j=0;j<n;j++){
								if(a[i][j]==b[k]){//????????????????? 
									cout<<"("<<x[i]<<","<<y[i]<<","<<z[i]<<")"<<"-"<<"("<<x[j]<<","<<y[j]<<","<<z[j]<<")=";
									printf("%.2lf",b[k]);//?????? 
									cout<<'\n';
									}
								}
							}
						}
					}
					
					return 0;
	}
//**************************
//*?????(14-4) ????  **
//*?????? 1200012888 **
//*???2013.12.11**
//**************************
struct							//????????? Point ?? x y z ??
{
	int x;
	int y;
	int z;
}Point[10];						//????? Point
struct dis						//????????? dis ?? ????d???????Point????????
{
	int pos_1;
	int pos_2;
	double d;
}Dis[45];
int main()
{
	int n;
	cin >> n;
	for (int i = 0 ; i < n ; i++)								//??n?????
	{
		cin >> Point[i].x >> Point[i].y >> Point[i].z;
	}
	int count = 0;												//count????
	for (int i = 0 ; i < n ; i ++)
	{
		for (int j = i + 1 ; j < n ; j ++)
		{
			Dis[count].d = sqrt(1.0*(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[count].pos_1 = i;								//?????????
			Dis[count].pos_2 = j;
			count ++;
		}
	}
	for (int i = 0 ; i < count - 1 ; i ++)						//?????
	{
		for (int j = 0 ; j < count - i - 1; j++)
		{
			if (Dis[j].d < Dis[j + 1].d)
			{
				struct dis temp;
				temp = Dis[j];
				Dis[j] = Dis[j + 1];
				Dis[j + 1] = temp;
			}
		}
	}
	for (int i = 0 ; i < count ; i ++)						 //????????
	{
		cout << '(' <<  Point[Dis[i].pos_1].x << ','<<  Point[Dis[i].pos_1].y << ','<<  Point[Dis[i].pos_1].z << ')' << '-' << '(' <<  Point[Dis[i].pos_2].x << ','<<  Point[Dis[i].pos_2].y << ','<<  Point[Dis[i].pos_2].z << ')' << '=';
		cout << fixed << setprecision(2) << Dis[i].d << endl;
 	}
	return 0;
}
int main()
{
	int n,i,j,k;
	int x[10],y[10],z[10];
	double t;
	double d[45];
	cin>>n;
	for(i=0;i<n;i++)
		cin>>x[i]>>y[i]>>z[i];
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
			d[(j-i)+(n-1+n-i)*i/2-1]=sqrt((double)((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j])));
	}
	for(i=0;i<n*(n-1)/2-1;i++)
	{
		for(j=i+1;j<n*(n-1)/2;j++)
		{	
			if(d[i]<d[j])
			{t=d[i];d[i]=d[j];d[j]=t;
			}
		}
	}
	for(k=0;k<n*(n-1)/2;k++)
	{
	    if(d[k]!=d[k+1])
		{
			for(i=0;i<n-1;i++)
			{
		        for(j=i+1;j<n;j++)
				{	 
					if(sqrt((double)((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j])+(z[i]-z[j])*(z[i]-z[j])))-d[k]==0)
					 {cout<<"("<<x[i]<<","<<y[i]<<","<<z[i]<<")-("<<x[j]<<","<<y[j]<<","<<z[j]<<")=";
					  cout<<(fixed)<<setprecision(2)<<d[k]<<'\n';
					 }
				}
			}
		}
	}
	return 0;
}
int main()
{
	int n,i,j=0,k,r,g,o,l;
	int x[100],y[100],z[100];
	int q[100],w[100];
	double s[450],e;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
	}
	for(k=0;k<n-1;k++){
		for(i=k+1;i<n;i++){
			s[j]=1.0*pow((x[k]-x[i]),2)+pow((y[k]-y[i]),2)+pow((z[k]-z[i]),2);
			s[j]=sqrt(s[j]);
			q[j]=k;
			w[j]=i;
			j++;
		}
	}
	for(g=1;g<=j;g++){
		for(r=0;r<j-g;r++){
			if(s[r]<s[r+1]){
				e=s[r+1];
				s[r+1]=s[r];
				s[r]=e;
				o=q[r+1];
				q[r+1]=q[r];
				q[r]=o;
				l=w[r+1];
				w[r+1]=w[r];
				w[r]=l;
			}
		}
	}
	for(r=0;r<=j-1;r++){
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[q[r]],y[q[r]],z[q[r]],x[w[r]],y[w[r]],z[w[r]],s[r]);
	}
	return 0;
}
int main(){
	int i,a[1000][3],n,e,j,k=0,h;
	double m[3000][3],r,p,q;
	scanf("%d",&n);
    h=n*(n-1)/2;
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d",&a[i][0],&a[i][1],&a[i][2]);
	}
	for(i=0;i<n;i++)
    {
		for(j=i+1;j<n;j++)
		{
			m[k][0]=i;
			m[k][1]=j;
			m[k][2]=sqrt((double) ((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=0;i<h;i++)
    {
      for(k=0;k<h-1-i;k++)
	  {
		if(m[k][2]<m[k+1][2])
		{
            r=m[k][0];
            m[k][0]=m[k+1][0];
            m[k+1][0]=r;
			p=m[k][1];
            m[k][1]=m[k+1][1];
            m[k+1][1]=p;
			q=m[k][2];
            m[k][2]=m[k+1][2];
            m[k+1][2]=q;
		}
	  }
	}
	for(i=0;i<h;i++)
	printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",a[(int)m[i][0]][0],a[(int)m[i][0]][1],a[(int)m[i][0]][2],a[(int)m[i][1]][0],a[(int)m[i][1]][1],a[(int)m[i][1]][2],m[i][2]);
    return 0;
}
int main()
{
        int spot[100][3],n,i,j,k=0;
        struct D
        {
                int s[2][3];
                double d;
        } D[1000],tem;
        scanf("%d",&n);
        for (i=0;i<n;i++)
                scanf("%d%d%d",&spot[i][0],&spot[i][1],&spot[i][2]);
        for (i=0;i<n-1;i++)
        {
                for (j=i+1;j<n;j++)
                {
                        D[k].s[0][0]=spot[i][0];
                        D[k].s[0][1]=spot[i][1];
                        D[k].s[0][2]=spot[i][2];
                        D[k].s[1][0]=spot[j][0];
                        D[k].s[1][1]=spot[j][1];
                        D[k].s[1][2]=spot[j][2];
                        D[k].d=(double)sqrt((spot[i][0]-spot[j][0])*(spot[i][0]-spot[j][0])+(spot[i][1]-spot[j][1])*(spot[i][1]-spot[j][1])+(spot[i][2]-spot[j][2])*(spot[i][2]-spot[j][2]));
                        k++;
                }
        }
        for(i=0;i<k;i++)
                for(j=k-1;j>i;j--)
                {
                        if (D[j].d>D[j-1].d)
                        {
                                tem=D[j];
                                D[j]=D[j-1];
                                D[j-1]=tem;
                        }
                }
        for (i=0;i<k;i++)
                printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",D[i].s[0][0],D[i].s[0][1],D[i].s[0][2],D[i].s[1][0],D[i].s[1][1],D[i].s[1][2],D[i].d);
}
//****************************************************** 
//* ? ? ?   ?? ? ? ?                           *
//* ? ?      ?? ? ?                              *
//* ? ? ? ??2010 ? 12 ? 15 ?                   * 
//* ? ?      ?1000010185                            *
//****************************************************** 
int main()
{
	struct distance // ???????????????
	{
		int x[3];
		int y[3];
		double d;
	} dis[45], temp;
	int n, a[10][3]; // ??a???n????
	cin >> n;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < 3; j++)
			cin >> a[i][j];
	// ?n?????????????dis?
	int k = 0;
	for (int i = 0; i < n; i++)
		for (int j = i + 1; j < n; j++)
		{
			for (int p = 0; p < 3; p++)
			{
				dis[k].x[p] = a[i][p];
				dis[k].y[p] = a[j][p];
			}
			k++;
		}

	// ??????????
	int k1 = n * (n - 1) / 2;
	for (int i = 0; i < k1; i++)
	{
		double sum = 0;
		for (int j = 0; j < 3; j++)
			sum += (dis[i].x[j] - dis[i].y[j]) * (dis[i].x[j] - dis[i].y[j]);
		dis[i].d = sqrt(sum);
		for (int j = i - 1; j >= 0; j--)
			if (dis[j + 1].d > dis[j].d)
			{
				temp = dis[j];
				dis[j] = dis[j + 1];
				dis[j + 1] = temp;
			}
	}

	// ???????????
	for (int i = 0; i < k1; i++)
		cout << '(' << dis[i].x[0] << ',' << dis[i].x[1] << ',' << dis[i].x[2] << ")-(" << dis[i].y[0]
			 << ',' << dis[i].y[1] << ',' << dis[i].y[2] << ")=" << fixed << setprecision(2) << dis[i].d << endl;
	return 0;
}
int main()
{
	int n, i, j, k = 0;
	cin >> n;
	int num = n * (n - 1) / 2;
	int a[10][3];
	for ( i = 0; i < n; i++)
		for ( j = 0; j < 3; j++)
			cin >> a[i][j];
	double b[10][10];
	double c[45];
	for ( i = 0; i < n - 1; i++)
		for ( j = i + 1; j < n; j++)
			{
				double len1, len2, len3;
				len1 = pow(a[i][0] - a[j][0], 2.0);
				len2 = pow(a[i][1] - a[j][1], 2.0);
				len3 = pow(a[i][2] - a[j][2], 2.0);
				b[i][j] = sqrt(len1 + len2 + len3);
				c[k++] = b[i][j];
			}
	double temp;
	for(i = 0; i < num - 1; i++)
		for (j = 0; j < num - 1 - i; j++)
		{
			if ((c[j] < c[j + 1]) )
			{
				temp = c[j];
				c[j] = c[j + 1];
				c[j + 1] = temp;
			}
		}
	for (k = 0; k < num; k++)
	{
		if (k == 0)
		{
			for ( i = 0; i < n; i++)
				for ( j = i + 1; j < n; j++)
					if (fabs(b[i][j] - c[k]) < 1e-9)
					{
						cout << fixed;
						cout << "(" << a[i][0] << "," << a[i][1] << "," << a[i][2] << ")" << "-";
						cout << "(" << a[j][0] << "," << a[j][1] << "," << a[j][2] << ")";
						cout << "=" << setprecision(2) << b[i][j] << endl;
					}
		}
		else
		{
			while (fabs(c[k] - c[k - 1]) < 1e-9)
				k++;
			for ( i = 0; i < n; i++)
				for ( j = i + 1; j < n; j++)
					if (fabs(b[i][j] - c[k]) < 1e-9)
					{
						cout << fixed;
						cout << "(" << a[i][0] << "," << a[i][1] << "," << a[i][2] << ")" << "-";
						cout << "(" << a[j][0] << "," << a[j][1] << "," << a[j][2] << ")";
						cout << "=" << setprecision(2) << b[i][j] << endl;
					}
		}
    }
	return 0;
}
main()
{
	int i,j,p=0,n,b[10][3];
	struct qwe
	{
		int a[3];
		int b[3];
		int jl;
	}t[45],e;
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d%d%d",*(b+i),*(b+i)+1,*(b+i)+2);
	for(i=0;i<n-1;i++)
	{
		for(j=i+1;j<n;j++)
		{
			t[p].a[0]=b[i][0];
			t[p].a[1]=b[i][1];
			t[p].a[2]=b[i][2];
			t[p].b[0]=b[j][0];
			t[p].b[1]=b[j][1];
			t[p].b[2]=b[j][2];
			t[p].jl=(b[i][0]-b[j][0])*(b[i][0]-b[j][0])+(b[i][1]-b[j][1])*(b[i][1]-b[j][1])+(b[i][2]-b[j][2])*(b[i][2]-b[j][2]);
			p++;
		}
	}
	for(i=0;i<p;i++)
	{
		for(j=0;j<p-i-1;j++)
		{
			if(t[j].jl<t[j+1].jl)
			{
				e=t[j];
				t[j]=t[j+1];
				t[j+1]=e;
			}
		}
	}
	for(i=0;i<p;i++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",t[i].a[0],t[i].a[1],t[i].a[2],t[i].b[0],t[i].b[1],t[i].b[2],sqrt(t[i].jl));
	}
}
struct point{
	int a,b,c;
	}x[10];
int d(int k,int n)
{
	int i;
	for(i=n-1;k>i;i--)
		k-=i;
	return(n-i-1);
}
int f(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[46],t;
	float y[46];
	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++)
	{
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",x[d(q[i]+1,n)].a,x[d(q[i]+1,n)].b,x[d(q[i]+1,n)].c,x[f(q[i]+1,n)].a,x[f(q[i]+1,n)].b,x[f(q[i]+1,n)].c,y[q[i]]);
	}
}
/*
*????04.cpp
*??????
*?????2011-12-15
*???????????n??????10??,??n?????????,???????????????????????????
*/

int main()
{
	int n;     //?????????
	cin>>n;
	struct zb     //?????????????
	{
		int x;
		int y;
		int z;
	}dian[n];
	for(int i=0;i<n;i++)     //????
		cin>>dian[i].x>>dian[i].y>>dian[i].z;
    double distance[n][n];     //????????
    for(int i=0;i<n;i++)     
        for(int j=0;j<n;j++)
        	distance[i][j]=0.0;
    for(int i=0;i<n-1;i++)     //?????????
    	for(int j=i+1;j<n;j++)
    		distance[i][j]=(sqrt)((dian[i].x-dian[j].x)*(dian[i].x-dian[j].x)+(dian[i].y-dian[j].y)*(dian[i].y-dian[j].y)+(dian[i].z-dian[j].z)*(dian[i].z-dian[j].z));
    int amount=n*(n-1)/2;
    for(int i=0;i<amount;i++)     //??????????
    {
    	double maxdis=0;
        int maxX=0,maxY=0;
    	for(int j=0;j<n-1;j++)     //??????????????????
    	{
    		for(int k=j+1;k<n;k++)
    		{
    			if(maxdis<distance[j][k])
    			{
    				maxdis=distance[j][k];
    				maxX=j;
    				maxY=k;
    			}
    		}
    	}
    	cout<<"("<<dian[maxX].x<<","<<dian[maxX].y<<","<<dian[maxX].z<<")"<<"-"<<"("<<dian[maxY].x<<","<<dian[maxY].y<<","<<dian[maxY].z<<")"<<"=";
		cout<<fixed<<setprecision(2)<<maxdis<<endl;
        distance[maxX][maxY]=0.0;
    }
    return 0;
}
int main(){
	int i,j,l,k=0,n;
	cin >> n;
	double x[11],y[11],z[11],dis[11][11],temp[50],ins;
	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++){
			dis[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]);  //?i???j????????
			temp[k]=dis[i][j];  //??????????
			k++;
		}
	}
	for(i=0;i<k;i++){   //?????????
		for(j=0;j<k-i-1;j++){
			if(temp[j]>temp[j+1]){
				ins=temp[j+1];
				temp[j+1]=temp[j];
				temp[j]=ins;
			}
		}
	}
	for(l=k-1;l>=0;l--){  //????
		for(i=0;i<n;i++){
			for(j=i+1;j<n;j++){
				if(dis[i][j]==temp[l]) {  //????????????????
					cout << fixed << setprecision(0)<<'(' << x[i]<<','<<y[i]<<','<<z[i]<<")-("<<x[j]<<','<<y[j]<<','<<z[j]<<")="<<fixed << setprecision(2)<<sqrt(temp[l])<<endl;
					//??????
					dis[i][j]=-1; //??????????????????-1?????temp[]??
				}

			}
		}
	}
	return 0;


}
int main()
{
	int x[10],y[10],z[10];
	int n,i,j,p,m,h;
	double k,l[10][10];
	cin>>n;
	for(i=0;i<n;i++)
		cin>>x[i]>>y[i]>>z[i];
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
		{
			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[i][j]=sqrt(k);
		}
	for(h=1;h<=n*(n-1)/2;h++)
	{
		double max=0;
		for(i=0;i<n-1;i++)
			for(j=i+1;j<n;j++)
				if(max<l[i][j])
				{
					max=l[i][j];
					p=i,m=j;
				}
		cout<<"("<<x[p]<<","<<y[p]<<","<<z[p]<<")-("<<x[m]<<","<<y[m]<<","<<z[m]<<")="<< fixed << setprecision(2)<<l[p][m]<<endl;
		l[p][m]=0;
	} 
	return 0;
}
//*******************************
//*???????              **
//*?????? 1300012965     **
//*???20131211              **
//*******************************
struct zb
	{
		int x;
		int y;
		int z;
	}a[11];//??????
int main()
{
	double l[100] = {0.0};
	int i, j, k, n, co = 0, q[100] = {0}, temp, x1, y1, co1 = 0; 
	double lo, t;
	cin >> n;
	for(int p=1; p<=n*(n-1)/2; p++)
		q[p] = p;//???????
	for(i=1; i<=n; i++)
		cin >> a[i].x >> a[i].y >> a[i].z;
	for(j=1; j<=n-1; j++)
		for(k=j+1; k<=n; k++)
		{
			lo = sqrt(((a[j].x-a[k].x)*(a[j].x-a[k].x)+
			(a[j].y-a[k].y)*(a[j].y-a[k].y)+
			(a[j].z-a[k].z)*(a[j].z-a[k].z))*1.0);//????
			co++;
			l[co] = lo;
		}
		
	for(int x=1; x<=n*(n-1)/2-1; x++)
		for(int y=1; y<=n*(n-1)/2-x; y++)
			if(l[y] < l[y+1])
			{
				t = l[y];
				l[y] = l[y+1];
				l[y+1] = t;//????
				temp = q[y];
				q[y] = q[y+1];
				q[y+1] = temp;//????????
			}
	for(int x=1; x<=n*(n-1)/2; x++)
	{
		co1++;
		for(int y=1; y<=n; y++)
		{
			
			if(q[co1] > n-y)
				q[co1] -= n-y;
			else
			{
				x1 = y;
				y1 = q[co1] + y;//???????
				break;
			}
		}
		cout << "(" << a[x1].x << "," << a[x1].y << "," << a[x1].z << ")-("
			<< a[y1].x << "," << a[y1].y << "," << a[y1].z << ")=" << fixed <<
			setprecision(2) << l[x] << endl;
	}
	return 0;
}
int main()
{
	int n,i=0,j=0,k=0;;
	double x[10],y[10],z[10],d[100],t,s,c[10][10]={0};
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>x[i]>>y[i]>>z[i];
	}
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			d[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++;
		}
	}
	for(int k=0;k<(n*(n-1)/2)-1;k++)
	{
	for(int l=0;l<(n*(n-1)/2)-1;l++)
	{
		if(d[l]<d[l+1])
		{
			t=d[l+1];
			d[l+1]=d[l];
			d[l]=t;
		}
	}
	}
	for(int k=0;k<(n*(n-1)/2);k++)
	{
		s=0;
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			if(d[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]))&&s==0&&c[i][j]==0)
			{
				cout<<"("<<fixed<<setprecision(0)<<x[i]<<","<<fixed<<setprecision(0)<<y[i]<<","<<fixed<<setprecision(0)<<z[i]<<")-("<<fixed<<setprecision(0)<<x[j]<<","<<fixed<<setprecision(0)<<y[j]<<","<<fixed<<setprecision(0)<<z[j]<<")="<<fixed<<setprecision(2)<<d[k]<<endl;
				s+=1;
				c[i][j]+=1;
			}
		}
	}
	}
	return 0;
}
int main()
{
	int n,i,j,i1,j1,k;
	double x[11],y[11],z[11],r[10][11];//?i????j??????r[i][j],?i??????(x[i],y[i],z[i])
	cin>>n;//?n??
	for(i=1;i<=n;i++)
		cin>>x[i]>>y[i]>>z[i];//????
	for(i=1;i<n;i++){
		for(j=1;j<=n;j++)
			r[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]));
	}//?????????
	double max=0;//?max?????????
	for(k=1;k<=100;k++){
	for(i=1;i<n;i++){
		for(j=i;j<=n;j++){
			if(r[i][j]>max){
				max=r[i][j];
				i1=i;j1=j;//????????????
			}
			}
		}
	if(max!=0){
			cout<<fixed<<setprecision(0)<<"("<<x[i1]<<","<<y[i1]<<","<<z[i1]<<")-("<<x[j1]<<","<<y[j1]<<","<<z[j1]<<")=";
			cout<<fixed<<setprecision(2)<<r[i1][j1]<<endl;
			r[i1][j1]=0;//???????
			max=0;}
	}
	return 0;
}
int main()
{
	int n,i,j,k=0,d,e,x[100],y[100],z[100];
	double m,a[100][100]={-1},b[500]={-1},c[500];
	scanf("%d",&n);
	for(i=0;i<n;i++)
		scanf("%d%d%d",&x[i],&y[i],&z[i]);
    for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			a[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]));
			b[k]=a[i][j];
			k++;
		}
	}
	for(i=0;i<k-1;i++){
		for(j=0;j<k-i-1;j++){
			if(b[j]<b[j+1]){
				m=b[j];
				b[j]=b[j+1];
				b[j+1]=m;
			}
		}
	}
	e=1;
	for(i=0;i<k-1;i++){
		if(b[i]==b[i+e]){
			for(e=1;1;e++){
				if(b[i]==b[i+e])
					b[i+e]=-1;
				else
					break;
            }
		}
	}
	j=0;
	for(i=0;i<k;i++){
		if(b[i]!=-1){
			c[j]=b[i];
			j++;
		}
	}
	for(i=0;i<j;i++){
		for(k=0;k<n-1;k++){
			for(d=k+1;d<n;d++){
				if(a[k][d]==c[i])
					printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",x[k],y[k],z[k],x[d],y[d],z[d],c[i]);
			}
		}
	}
	return 0;
}
int main()
{
    int a[1000][3],n,m,l=1,i,j;
    double b[3000][3],q,w,e;
    scanf("%d",&n);
    m=n*(n-1)/2;
    for( i=1;i<=n;i++){
      for(j=1;j<=3;j++){
            scanf("%d",&a[i][j]);
            }}
    for(i=1;i<=n;i++){
         for( j=i+1;j<=n;j++){
                 b[l][1]=i;
                 b[l][2]=j;
                 b[l][3]=sqrt((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])
                     )
                     );
                 l++;}
                 }
    for(i=1;i<=m;i++){
            for( j=1;j<=m-i;j++){
                    if(b[j][3]<b[j+1][3]){
                         q=b[j][1];        w=b[j][2];        e=b[j][3];
                         b[j][1]=b[j+1][1];b[j][2]=b[j+1][2];b[j][3]=b[j+1][3];
                         b[j+1][1]=q;       b[j+1][2]=w;      b[j+1][3]=e;
                                         }
                                 }
                        } 
    for(i=1;i<=m;i++){
            printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",
            a[(int)b[i][1]][1],a[(int)b[i][1]][2],a[(int)b[i][1]][3],
            a[(int)b[i][2]][1],a[(int)b[i][2]][2],a[(int)b[i][2]][3],
            b[i][3]);
            }                
            return 0;
}
struct zz
{
    float key;
    int num1,num2;    
}a[1005]={0,0,0},va;
int main()
{
    int n;

    cin>>n;
    float x[n+5],y[n+5],z[n+5];
    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].key=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[k].num1=i;
            a[k].num2=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].key<a[j+1].key || (a[j].key == a[j+1].key && a[j].num1 > a[j+1].num1) || (a[j].key == a[j+1].key && a[j].num1 == a[j+1].num1 && a[j].num2 > a[j+1].num2))
            {
                va=a[j];
                a[j]=a[j+1];
                a[j+1]=va;
            }
        }
    }
    for(int i=0;i<(n-1)*n/2;i++)
        printf("(%.0f,%.0f,%.0f)-(%.0f,%.0f,%.0f)=%.2f\n",x[a[i].num1],y[a[i].num1],z[a[i].num1],x[a[i].num2],y[a[i].num2],z[a[i].num2],a[i].key);
                        
    return 0;	
}
struct suanshi{
	int a[3],b[3];
	int no;
	float x;
}dian[45];
int cmp(const void *a,const void *b){
	struct suanshi *aa=(struct suanshi *)a;
	struct suanshi *bb=(struct suanshi *)b;
	if((aa->x)<(bb->x))return 1;
	if((aa->x)>(bb->x))return -1;
	else return (aa->no)-(bb->no);
}
void main(){
	int point[11][3];
	int n,i,j,t=0;
	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;i++){
		for(j=i+1;j<n;j++){
			dian[t].no=t+1;
			dian[t].a[0]=point[i][0];dian[t].a[1]=point[i][1];dian[t].a[2]=point[i][2];
			dian[t].b[0]=point[j][0];dian[t].b[1]=point[j][1];dian[t].b[2]=point[j][2];
			dian[t].x=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]));
			t++;
		}
	}
	for(j=0;n>0;){
		n--;
		j+=n;
	}
	qsort(dian,j,sizeof(struct suanshi),cmp);
	for(i=0;i<j;i++)
		printf("(%d,%d,%d)-(%d,%d,%d)=%.2f\n",dian[i].a[0],dian[i].a[1],dian[i].a[2],dian[i].b[0],dian[i].b[1],dian[i].b[2],dian[i].x);
}
int main()
{
	int n;
	cin>>n;
	int x[n],y[n],z[n],p,q;
	float d[n][n-1],t;
	float a[n*(n-1)/2];
    int k=0;
    int b[n*(n-1)/2],c[n*(n-1)/2];
	for(int i=0;i<n;i++)
		cin>>x[i]>>y[i]>>z[i];

	for(int i=0;i<n;i++)
		for(int 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]));
			a[k]=d[i][j];b[k]=i;c[k]=j;
			k++;

				}
	for(int i=1;i<n*(n-1)/2;i++)
		for(int j=0;j<n*(n-1)/2-i;j++)
		{
			if(a[j]<a[j+1])
			{
				t=a[j];
				a[j]=a[j+1];
				a[j+1]=t;
				p=b[j];
								b[j]=b[j+1];
								b[j+1]=p;
								q=c[j];
												c[j]=c[j+1];
												c[j+1]=q;
			}
		}
	for(int i=0;i<k;i++)
	{
		cout<<"("<<x[b[i]]<<","<<y[b[i]]<<","<<z[b[i]]<<")-"<<"("<<x[c[i]]<<","<<y[c[i]]<<","<<z[c[i]]<<")="<<fixed<<setprecision(2)<<a[i]<<endl;
	}

return 0;


}
int main()
{
	int n,m,i,j,x,y,t=0;
	cin>>n;
	int a[10],b[10],c[10],e[100];
	double d[100];
	for(i=0;i<n;i++)
		cin>>a[i]>>b[i]>>c[i];
	for(i=0;i<n;i++)
		for(j=i+1;j<n;j++)
		{e[t]=10*i+j;
		d[e[t]]=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]));
		t++;
		}
	for(i=1;i<t;i++)
		for(j=0;j<t-i;j++)
		{if(d[e[j]]<d[e[j+1]])
		{
		m=e[j];
		e[j]=e[j+1];
		e[j+1]=m;
		}}
	for(i=0;i<t;i++)
	{x=e[i]%10;
	y=(e[i]-x)/10;
	cout<<"("<<a[y]<<","<<b[y]<<","<<c[y]<<")-("<<a[x]<<","<<b[x]<<","<<c[x]<<")="<<fixed<<setprecision(2)<<d[e[i]]<<endl;
	}
	return 0;
}
int main(){
     int n,i,j,N,k,t;
     int a[11][4],b[50][7];
     double d[50],e;
     scanf("%d",&n);
     N=n*(n-1)/2;
     for(i=1;i<=n;i++){
          for(j=1;j<=3;j++){
               scanf("%d",&a[i][j]);
          }
     }
           t=1;
           for(i=1;i<n;i++){

                 for(j=i+1;j<=n;j++){                 b[t][3]=a[i][3];
                 b[t][1]=a[i][1];
                 b[t][2]=a[i][2];
                 b[t][6]=a[j][3];
                 b[t][4]=a[j][1];
                 b[t][5]=a[j][2];  
                  t++;                  
                 }
           }
    
     for(t=1;t<=N;t++){
           d[t]=sqrt((b[t][3]-b[t][6])*(b[t][3]-b[t][6])+(b[t][1]-b[t][4])*(b[t][1]-b[t][4])+(b[t][2]-b[t][5])*(b[t][2]-b[t][5]));
     }
     for(k=N;k>0;k--){
          for(i=1;i<k;i++){
               if(d[i]<d[i+1]){
                  e=d[i];
                  d[i]=d[i+1];
                  d[i+1]=e;
                  for(j=1;j<=6;j++){
                       e=b[i][j];
                       b[i][j]=b[i+1][j];
                       b[i+1][j]=e;
                  }
               }
          }
     }
     for(i=1;i<=N;i++){
          printf("(%d,%d,%d)-(%d,%d,%d)=%.2lf\n",b[i][1],b[i][2],b[i][3],b[i][4],b[i][5],b[i][6],d[i]);
     }
     return 0;
}