测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A8121. Points

编程题 普及/提高-

题目描述

You are given $N$ points on a plane. Write a program which will find the sum of squares of distances between all pairs of points.

输入格式

The first line of input contains one integer number $N$ ( $1<=N<=100000$ ) — the number of points. Each of the following $N$ lines contain two integer numbers $X$ and $Y$ ( $-10000<=X,Y<=10000$ ) — the coordinates of points. Two or more points may coincide.

输出格式

The only line of output should contain the required sum of squares of distances between all pairs of points.

输入输出样例

输入 #1
4
1 1
-1 -1
1 -1
-1 1
输出 #1
32
上一题 去做题 下一题