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

long long a[100005],b[100005],sumA[100005],sumB[100005];

int main(){

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

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

    for(long long 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;
}
