{"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\"\u003eHuah has $n+k$ cities numbered $1,2,.... ,n+k$, the city $i(1\\le i\u0026lt; n+k)$ to the city $i+1$ has $n+k-i$ distinct one-way roads.\u003cbr\u003e\u003cbr\u003eFor each $x\u003d1,2,...,n-1$,the city $i(x\u0026lt; i\\le n+k)$ to the city $i-x$ has $a_x$ distinct one-way roads.\u003cbr\u003e\u003cbr\u003eFor $m\u003dk+1,k+2,... ,k+n$,find the number of paths from city $k+1$ to city $m$ that pass through exactly $k$ number of roads.\u003cbr\u003e\u003cbr\u003eTwo paths are distinct when and only if the sequence of edges they pass through is distinct and the answer is modulo $998244353$.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"First line has one integer $T(1\\le T\\le 14)$, indicating there are $T$ test cases. In each case:\u003cbr\u003e\u003cbr\u003eFirst line input two integers $n,k(2\\le n\\le 2\\times 10^5,1\\le k\\le 2\\times 10^5)$.\u003cbr\u003e\u003cbr\u003eSecond line $n-1$ integers $a_1,a_2,... ,a_{n-1}(0\\le a_i\\le 998244352)$.\u003cbr\u003e\u003cbr\u003eThere is a blank line between case $i(1\\le i\u0026lt; T)$ and case $i+1$.\u003cbr\u003e\u003cbr\u003eInput guarantee $\\sum (n+k) \\le 1006769$."}},{"title":"Output","value":{"format":"HTML","content":"In each case, output a row of $n$ integers with the $i$-th integer being the answer when $m\u003dk+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\u003e4\r\n3 2\r\n1 2\r\n\r\n3 1\r\n1 2\r\n\r\n5 10\r\n2 3 3 3\r\n\r\n3 3\r\n166374059 748683265\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5 0 2\r\n0 2 0\r\n114307026 825469567 425461680 73846080 5140800\r\n5 2 0\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}