{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003eClarke is a patient with multiple personality disorder. One day, he turned into a mathematician, did a research on interesting things. \u003cbr\u003eSuddenly he found a interesting formula. Given $f(i), 1 \\le i \\le n$, calculate \u003cbr\u003e$\\displaystyle g(i) \u003d \\sum_{i_1 \\mid i} \\sum_{i_2 \\mid i_1} \\sum_{i_3 \\mid i_2} \\cdots \\sum_{i_k \\mid i_{k-1}} f(i_k) \\text{ mod } 1000000007 \\quad (1 \\le i \\le n)$\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains an integer $T(1 \\le T \\le 5)$, the number of test cases. \u003cbr\u003eFor each test case, the first line contains two integers $n, k(1 \\le n, k \\le 100000)$. \u003cbr\u003eThe second line contains $n$ integers, the $i$th integer denotes $f(i), 0 \\le f(i) \u0026lt; 10^9+7$."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, print a line contained $n$ integers, the $i$th integer represents $g(i)$."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n6 2\r\n2 3 3 3 3 3\r\n23 3\r\n2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2 7 7 15 7 23\r\n2 9 9 24 9 39 9 50 24 39 9 102 9 39 39 90 9 102 9 102 39 39 9\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"In the first sample case:\u003cbr\u003ef(1)\u003d2,f(2)\u003df(3)\u003df(4)\u003df(5)\u003df(6)\u003d3\u003cbr\u003ewhen k\u003d1\u003cbr\u003eg(1)\u003df(1)\u003d2,g(2)\u003df(1)+f(2)\u003d5,g(3)\u003df(1)+f(3)\u003d5,g(4)\u003df(1)+f(2)+f(4)\u003d2+3+3\u003d8,g(5)\u003df(1)+f(5)\u003d5,g(6)\u003df(1)+f(2)+f(3)+f(6)\u003d2+3+3+3\u003d10\u003cbr\u003ewhen k\u003d2\u003cbr\u003eg(1)\u003df(1)\u003d2,g(2)\u003df(1)+(f(1)+f(2))\u003d7,g(3)\u003df(1)+(f(1)+f(3))\u003d7,g(4)\u003df(1)+(f(1)+f(2))+(f(1)+f(4))\u003d15,g(5)\u003df(1)+(f(1)+f(5))\u003d7,g(6)\u003df(1)+(f(1)+f(2))+(f(1)+f(3))+(f(1)+f(2)+f(3)+f(6))\u003d23\u003cbr\u003eTherefore output\u003cbr\u003e2 7 7 15 7 23\u003cbr\u003e"}}]}