跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F0902. Points

  • ID: 908
  • 传统题
  • 2000ms
  • 256MiB
  • 尝试: 0
  • AC · 已通过: 0
  • 教学难度:进阶
  • 上传者:
  • 模拟
  • 数学
  • 编程与模拟
  • 进阶
  • 难度
  • 共享题库
  • Codeforces
  • 英文题面
  • 题目来源
  • 题面语言

Points

题目描述

E. Points
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 336 题。保留原作者与原赛事署名。