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


struct point
{
    short int x,y;
    bool visited;
};
double distance_p(struct point a,struct point b)
{
    int c = abs(a.y-b.y);
    int d = abs(a.x-b.x);
    return sqrt(c*c+d*d);
}

int main()
{
    int n;
    cin >> n;
    struct point arr[n];

    for(int i=0; i<n;i++)
    {
        cin >> arr[i].x >> arr[i].y;
    }

    double res=0;
    for(int i=0; i<n;i++)
    {
        for(int j=0; j<n;j++)
        {
            if(i==j || arr[j].visited==false)
                continue;
            double distance = distance_p(arr[i],arr[j]);
            cout << distance<<endl;
            /*cout << arr[i].x <<"-"<<arr[i].y
                << arr[j].x <<"-"<<arr[j].y
                << " = " << distance << endl;*/
            res+=distance*distance;
        }
        arr[i].visited = true;
    }
    cout << res;
    return 0;
}
