300403: CF76E. Points

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Points

题意翻译

题目描述 你有n个点,请编写一个程序,求这n个点的距离的平方和。 输入输出格式 输入: 第一行:n(0≤n≤100000); 接下来n行:每行两个数x,y,表示该点坐标(-10000≤x,y≤10000)。 输出:仅一行:所有点的距离的平方和。

题目描述

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

Input

题意翻译

题目描述 你有n个点,请编写一个程序,求这n个点的距离的平方和。 输入输出格式 输入: 第一行:n(0≤n≤100000); 接下来n行:每行两个数x,y,表示该点坐标(-10000≤x,y≤10000)。 输出:仅一行:所有点的距离的平方和。

加入题单

算法标签: