{"problem":{"name":"All Pair Digit Sums","description":{"content":"For a positive integer $x$, let $f(x)$ denote the sum of its digits. For instance, $f(158) = 1 + 5 + 8 = 14$, $f(2023) = 2 + 0 + 2 + 3 = 7$, and $f(1) = 1$. You are given a sequence of positive intege","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":4000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc158_c"},"statements":[{"statement_type":"Markdown","content":"For a positive integer $x$, let $f(x)$ denote the sum of its digits. For instance, $f(158) = 1 + 5 + 8 = 14$, $f(2023) = 2 + 0 + 2 + 3 = 7$, and $f(1) = 1$.\nYou are given a sequence of positive integers $A = (A_1, \\ldots, A_N)$. Find $\\sum_{i=1}^N\\sum_{j=1}^N f(A_i + A_j)$.\n\n## Constraints\n\n*   $1\\leq N\\leq 2\\times 10^5$\n*   $1\\leq A_i < 10^{15}$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $\\ldots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc158_c","tags":[],"sample_group":[["2\n53 28","36\n\nWe have $\\sum_{i=1}^N\\sum_{j=1}^N f(A_i + A_j) = f(A_1+A_1)+f(A_1+A_2)+f(A_2+A_1)+f(A_2+A_2)=7+9+9+11=36$."],["1\n999999999999999","135\n\nWe have $\\sum_{i=1}^N\\sum_{j=1}^N f(A_i + A_j) = f(A_1+A_1) = 135$."],["5\n123 456 789 101 112","321"]],"created_at":"2026-03-03 11:01:14"}}