4356: Points 点

内存限制:256 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较 上传者:
提交:5 通过:3

题目描述

    在平面上给你 N 个点。编写一个程序,它将找到所有点对之间的距离平方和。
    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.
Input
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.
Output
The only line of output should contain the required sum of squares of distances between all pairs of points.
Examples
Input
4
1 1
-1 -1
1 -1
-1 1
Output
32

输入格式

输入
输入的第一行包含一个整数 N (1≤N≤100000) - 点数。以下 N 行中的每一条都包含两个整数 X 和 Y (-10000≤XY≤10000) - 点的坐标。两个或多个点可能重合。

输出格式

输出
唯一的输出行应包含所有点对之间所需的距离平方和。
例子
输入
4
1 1
-1 -1
1 -1
-1 1
输出
32


输入样例 复制

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

输出样例 复制

32