///even.cpp
#include <bits/stdc++.h>
#define ednl "\n"
using namespace std;

int a[100002],b[100002],sumA[100002],sumB[100002];

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n,ans=0;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i]>>b[i];
        sumA[i]=sumA[i-1]+a[i];
        sumB[i]=sumB[i-1]+b[i];
    }

    for(int i=1;i<=n;i++){
        ans+=(n-1)*a[i]*a[i];
        ans=ans-2*a[i]*(sumA[n]-sumA[i]);
        ans+=(n-1)*b[i]*b[i];
        ans=ans-2*b[i]*(sumB[n]-sumB[i]);
    }
    cout<<ans<<endl;

    return 0;
}


