{"raw_statement":[{"iden":"problem statement","content":"Let’s take a prime $P = 200\\,003$. You are given $N$ integers $A_1, A_2, \\ldots, A_N$. Find the sum of $((A_i \\cdot A_j) \\bmod P)$ over all $N \\cdot (N-1) / 2$ unordered pairs of elements ($i < j$).\nPlease note that the sum isn't computed modulo $P$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 200\\,000$\n*   $0 \\leq A_i < P = 200\\,003$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format.\n\n$N$\n$A_1$ $A_2$ $\\cdots$ $A_N$"},{"iden":"sample input 1","content":"4\n2019 0 2020 200002"},{"iden":"sample output 1","content":"474287\n\nThe non-zero products are:\n\n*   $2019 \\cdot 2020 \\bmod P = 78320$\n*   $2019 \\cdot 200002 \\bmod P = 197984$\n*   $2020 \\cdot 200002 \\bmod P = 197983$\n\nSo the answer is $0 + 78320 + 197984 + 0 + 0 + 197983 = 474287$."},{"iden":"sample input 2","content":"5\n1 1 2 2 100000"},{"iden":"sample output 2","content":"600013"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}