{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\n\u003cp\u003e由于问题集很难,所以这里给你一个简单的任务来解决。\u003c/p\u003e\n\u003cp\u003e给定一个由n个整数组成的数组a,你的任务是计算数组a的所有子集的乘积之和。(详见注释以获取更多说明)\u003c/p\u003e\n\u003cp\u003e数组a的子集定义为通过从原始数组a中删除零个或多个元素而获得的元素集合。\u003c/p\u003e\n"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e第一行包含一个整数T,其中T是测试用例的数量。\u003c/p\u003e\n\u003cp\u003e每个测试用例的第一行包含一个整数n(1≤n≤10^5),其中n是数组a的大小。\u003c/p\u003e\n\u003cp\u003e每个测试用例的第二行包含n个整数a_1, a_2, ..., a_n(1≤a_i≤10^6),给出数组a。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个测试用例,打印一行,其中包含数组a的所有子集的乘积之和。由于这个数字可能太大,打印答案模10^9+7。\u003c/p\u003e"}},{"title":"示例1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n3\n1 2 3\n2\n3 5\n1\n4512\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e23\n23\n4512\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}},{"title":"注释","value":{"format":"HTML","content":"\u003cp\u003e由于输入/输出可能达到巨大的大小,建议使用快速的输入/输出方法:例如,在C++中,更喜欢使用scanf/printf而不是cin/cout,在Java中,更喜欢使用BufferedReader/PrintWriter而不是Scanner/System.out。\u003c/p\u003e\n\u003cp\u003e在第一个测试用例中,数组a有6个子集,答案计算如下:\u003c/p\u003e\n\u003ccenter class\u003d\"tex-equation\"\u003e\n \u003cspan class\u003d\"tex-span\"\u003e(1) + (2) + (3) + (1×2) + (1×3) + (2×3) + (1×2×3) \u003d 23\u003c/span\u003e\n\u003c/center\u003e."}}]}