#include <iostream>
#include "math.h"
using namespace std;

void alldist(int *x, int *y, int n) 
{
    float d;
    for (int i = 0; i < n-1; i++)
    {
        for (int j = i + 1; j < n; j++)
        {
            d = sqrt(pow((x[j] - x[i]), 2) + pow((y[j] - y[i]), 2));
            cout <<"dist "<< i << ":" << j << " " << d << " ";
        }
            cout << endl;
    }
}
int main() {
	int *x=new int [5] {1, 4, 6, 2, 1}; 
    int *y=new int [5] {6, 7, 8, 9, 10}; 
    alldist(x, y, 5);
	return 0;
}