/ OPS / 题库 /

B Points

B 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.

#格式#
##输入格式##
For each test case, 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.

##输出格式##
One line of output should contain the required sum of squares of distances between all pairs of points.

#样例1#
##样例输入1##

4
1 1
-1 -1
1 -1
-1 1

##样例输出1##

32

#限制#
1000ms
32768KB

#提示#

#来源#
daimin

信息

ID
1843
难度
5
分类
category1 点击显示
标签
递交数
0
已通过
0
通过率
?
上传者