Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <cstring>
- #include <algorithm>
- #include <cmath>
- #include <cctype>
- #include <iostream>
- #include <vector>
- using namespace std;
- #define maxn (200000)
- #define ll long long
- #define ull unsigned long long
- #define PB(x) push_back(x)
- #define MP(x,y) make_pair(x,y)
- ll x[maxn],y[maxn];
- int n;
- ll sumx,sumy,sumx2,sumy2,N;
- int main(){
- scanf("%d",&n); N=n;
- for (int i=1;i<=n;i++) {
- int a,b; scanf("%d%d",&a,&b);
- x[i]=a; y[i]=b;
- }
- for (int i=1;i<=n;i++) sumx+=x[i];
- for (int i=1;i<=n;i++) sumy+=y[i];
- for (int i=1;i<=n;i++) sumx2+=x[i]*x[i];
- for (int i=1;i<=n;i++) sumy2+=y[i]*y[i];
- cout << ((-2ll*sumx*sumx+2ll*N*sumx2) + (-2ll*sumy*sumy+2ll*N*sumy2))/2ll << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement