{"problem":{"name":"Squared Error","description":{"content":"Given is a number sequence $A$ of length $N$.   Find the sum of squared differences of every pair of elements: $\\displaystyle \\sum_{i = 2}^{N} \\sum_{j = 1}^{i - 1} (A_i - A_j)^2$.","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc194_c"},"statements":[{"statement_type":"Markdown","content":"Given is a number sequence $A$ of length $N$.  \nFind the sum of squared differences of every pair of elements: $\\displaystyle \\sum_{i = 2}^{N} \\sum_{j = 1}^{i - 1} (A_i - A_j)^2$.\n\n## Constraints\n\n*   $2 \\le N \\le 3 \\times 10^5$\n*   $|A_i| \\le 200$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $A_3$ $\\cdots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc194_c","tags":[],"sample_group":[["3\n2 8 4","56\n\nWe have $\\sum_{i = 2}^{N} \\sum_{j = 1}^{i - 1} (A_i - A_j)^2 = (8 - 2)^2 + (4 - 2) ^ 2 + (4 - 8) ^ 2 = 56$."],["5\n-5 8 9 -4 -3","950"]],"created_at":"2026-03-03 11:01:14"}}