{"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\"\u003eOne day, Subconscious is facing a problem that reminds him of the horrible experience in a past contest. In that contest, the easiest problem requires to count the number of minimum spanning trees in a randomly generated graph.\u003cbr\u003e\u003cbr\u003eNow there is a graph with $n$ vertices labeled from $1$ to $n$. For each pair of vertices $u$ and $v~(1 \\le u \u0026lt; v \\le n)$, there will be no edge between them with probability $\\frac{p_0}{100}$, or an edge of weight $1$ with probability $\\frac{p_1}{100}$, or an edge of weight $2$ with probability $\\frac{p_2}{100}$, ..., or an edge of weight $k$ with probability $\\frac{p_k}{100}$, where $k$ is the maximum weight of an edge.\u003cbr\u003e\u003cbr\u003eHowever, your task is not finding the expected weight of the minimum spanning tree of the randomly generated graph since the graph may be disconnected and the task author does not know how to deal with such cases.\u003cbr\u003e\u003cbr\u003eThus, your task becomes, for each integer $s$ between $n-1$ and $k(n-1)$, calculating the probability that the graph is connected and the weight of the minimum spanning tree of the graph is exactly $s$.\u003cbr\u003e\u003cbr\u003eThe problem is so hard that even if our talent Subconscious has managed to solve it, he is not sure whether his solution works and wants to check the answers modulo $1\\,000\\,000\\,007$ with you.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The input contains several test cases, and the first line contains a single integer $T~(1 \\le T \\le 200)$, the number of test cases.\u003cbr\u003e\u003cbr\u003eFor each test case, the first line contains two integers $n~(2 \\le n \\le 40)$ and $k~(1 \\le k \\le 4)$, denoting the number of vertices of the randomly generated graph and the maximum weight of an edge.\u003cbr\u003e\u003cbr\u003eThe following line contains $k+1$ non-negative integers $p_0, p_1, p_2, \\cdots, p_k~(\\sum_{i\u003d0}^{k}p_i \u003d 100)$, describing the probability distribution of an edge between each pair of vertices.\u003cbr\u003e\u003cbr\u003eIt\u0027s guaranteed that no more than $20$ test cases satisfy $n\u0026gt;10$ and no more than $2$ test cases satisfy $n\u0026gt;20$.\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, with given $n$ and $k$, output a line containing $(k-1)(n-1)+1$ integers, the $i$-th of which is the probability that the graph is connected and the weight of the minimum spanning tree of the graph is exactly $n-2+i$, modulo $1\\,000\\,000\\,007$.\u003cbr\u003e\u003cbr\u003eMore precisely, if the reduced fraction of the probability is $\\frac{p}{q}$, what you should provide is the minimum non-negative integer $r$ such that $q r \\equiv p \\pmod{1\\,000\\,000\\,007}$. You may safely assume that such $r$ always exists in all test cases.\u003cbr\u003e"}},{"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\n3 1\r\n50 50\r\n3 2\r\n0 50 50\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e500000004\r\n500000004 375000003 125000001\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}