{"raw_statement":[{"iden":"statement","content":"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."},{"iden":"input","content":"The first line of input contains one integer number _N_ (1 ≤ _N_ ≤ 100 000) — the number of points. Each of the following _N_ lines contain two integer numbers _X_ and _Y_ ( - 10 000 ≤ _X_, _Y_ ≤ 10 000) — the coordinates of points. Two or more points may coincide."},{"iden":"output","content":"The only line of output should contain the required sum of squares of distances between all pairs of points."},{"iden":"examples","content":"Input\n\n4\n1 1\n-1 -1\n1 -1\n-1 1\n\nOutput\n\n32"}],"translated_statement":[{"iden":"statement","content":"给定平面上的 #cf_span[N] 个点。编写一个程序，求所有点对之间距离的平方和。\n\n输入的第一行包含一个整数 #cf_span[N] (#cf_span[1 ≤ N ≤ 100 000]) —— 点的数量。接下来的 #cf_span[N] 行每行包含两个整数 #cf_span[X] 和 #cf_span[Y] (#cf_span[ - 10 000 ≤ X, Y ≤ 10 000]) —— 点的坐标。可能存在两个或更多重合的点。\n\n输出仅一行，包含所有点对之间距离的平方和。"},{"iden":"input","content":"输入的第一行包含一个整数 #cf_span[N] (#cf_span[1 ≤ N ≤ 100 000]) —— 点的数量。接下来的 #cf_span[N] 行每行包含两个整数 #cf_span[X] 和 #cf_span[Y] (#cf_span[ - 10 000 ≤ X, Y ≤ 10 000]) —— 点的坐标。可能存在两个或更多重合的点。"},{"iden":"output","content":"输出仅一行，包含所有点对之间距离的平方和。"},{"iden":"examples","content":"输入\n4\n1 1\n-1 -1\n1 -1\n-1 1\n输出\n32"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ N \\in \\mathbb{Z} $ be the number of points.  \nLet $ P = \\{ p_i = (x_i, y_i) \\mid i \\in \\{1, \\dots, N\\} \\} $ be the set of points in $ \\mathbb{R}^2 $, where $ x_i, y_i \\in \\mathbb{Z} $.\n\n**Constraints**  \n1. $ 1 \\leq N \\leq 100{,}000 $  \n2. $ -10{,}000 \\leq x_i, y_i \\leq 10{,}000 $ for all $ i \\in \\{1, \\dots, N\\} $\n\n**Objective**  \nCompute the sum of squared Euclidean distances between all unordered pairs of distinct points:  \n$$\n\\sum_{1 \\leq i < j \\leq N} \\left( (x_i - x_j)^2 + (y_i - y_j)^2 \\right)\n$$","simple_statement":null,"has_page_source":false}