{"raw_statement":[{"iden":"background","content":"在漆黑的夜晚，魔女带走了 LMX，HQZ 为了拯救 LMX。要完成魔女给出的任务。"},{"iden":"statement","content":"魔女给出一个长度为 $n$ 的序列 $d$，魔女想要求得：\n\n$$\\sum\\limits_{i=1}^{ n}\\sum\\limits_{j=1}^{n}{((d_i\\oplus d_j)+(d_i \\otimes d_j))}$$\n\n其中定义 $\\oplus$ 代表二进制下两数相加的和数位上 $1$ 的个数， $\\otimes$ 代表二进制下较大减较小的差数位上 $1$ 的个数。"},{"iden":"input","content":"一行一个整数 $n$ 表示序列的长度。\n\n第二行 $n$ 个非负整数，表示序列 $d$。"},{"iden":"output","content":"一行一个整数表示答案。"},{"iden":"note","content":"**样例解释 #1**\n\n如下表所示，因此答案为 $1 + 2 + 2 + 2 = 7$。\n| $i$ | $j$ | $ans$ |\n| :-----: | :-----: | :-------: |\n| $1$ | $1$ | $1$ |\n| $1$ | $2$ | $2$ |\n| $2$ | $1$ | $2$ |\n| $2$ | $2$ | $2$ |\n\n\n对于 $100 \\%$ 的数据，保证 $1 \\le n\\le 2\\times 10^6,\\sum\\limits d_i\\le5\\times10^7$。 \n| 子任务编号 |     $n$     |          特殊性质          | 分值 |\n| :--------: | :------------------: | :-------------------------: | :--: |\n| Subtask #1 |     $\\le 2\\times10^6 $     |   $d_i =1$       |  $10$  |\n| Subtask #2 |     $\\le 5000$     |      无      |  $20$  |\n| Subtask #3 | $\\le 2\\times 10^6$ | $d_i$ 是 $2$ 的次幂 |  $30$  |\n| Subtask #4 | $\\le 2\\times 10^6$ |      无      |  $40$  |"}],"translated_statement":null,"sample_group":[["2\n1 3 ","7"],["10\n114514 19 19 810 1477 44151 15260 369 2010 222","1396"]],"show_order":[],"formal_statement":null,"simple_statement":null,"has_page_source":false}