{"problem":{"name":"E. Points","description":{"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.","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF76E"},"statements":[{"statement_type":"Markdown","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.\n\n## Input\n\nThe 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.\n\n## Output\n\nThe only line of output should contain the required sum of squares of distances between all pairs of points.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","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输出仅一行，包含所有点对之间距离的平方和。\n\n## Input\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## Output\n\n输出仅一行，包含所有点对之间距离的平方和。\n\n[samples]","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**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$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF76E","tags":["implementation","math"],"sample_group":[["4\n1 1\n-1 -1\n1 -1\n-1 1","32"]],"created_at":"2026-03-03 11:00:39"}}