{"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\"\u003eRecently, an interesting balloon-popping game can be commonly found near the streets. The rule of this game is quite simple: some balloons are tied to cells of an $n \\times m$ lattice, and you are allowed to throw $k$ darts to prick the balloons. The more balloons you pierce, the more incredible prize you will get.\u003cbr\u003e\u003cbr\u003eProbably because too many people have got bored with this childish game, a new variation of the game has appeared. In this variation, the balloons are replaced with more powerful ones: when a balloon explodes, strong gusts travel in four directions, blowing away all remaining balloons in the same row and column. In order to reduce the difficulty, not all cells are filled with a balloon.\u003cbr\u003e\u003cbr\u003eFor example, if you prick the yellow balloon in the following figure, then the red balloons will be blown away, with only the blue balloon remaining.\u003cbr\u003e\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/9b9610fd1c7b5528beb06c3dde42bc2d?v\u003d1715469617\"\u003e\u003c/center\u003e\u003cbr\u003e\u003cbr\u003eNow, you are given $k$ darts. Since you are a good dart player that you can precisely throw it to any position you want, it is easy for you to use these $k$ darts to clear all balloons (either by directly pricking, or by blowing away by other exploded balloons). Now you begin to consider: for every $1 \\leq x \\leq k$, how many different ways are there to clear all balloons with exactly $x$ darts? Two ways are considered different if and only if there exists $i$, such that the positions of $i$-th pricked balloons differ. Note that you cannot throw the dart to an empty cell.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line of input is a single integer $T$ $(1 \\leq T \\leq 100)$, denoting the number of test cases.\u003cbr\u003e\u003cbr\u003eEach test case begins with a line of three integers $m, n$ $(1 \\leq m \\leq 12, 1 \\leq n \\leq 20)$, denoting the size of the balloon lattice, and $k$ $(1 \\leq k \\leq 20)$, denoting the number of darts. The next $m$ lines, each containing $n$ characters, describe the balloon lattice. Each character is either $\\texttt{\u0027Q\u0027}$, which denotes a balloon, or $\\texttt{\u0027.\u0027}$, which denotes an empty cell."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, display $k$ lines. The $i$-th line is a single integer denoting the number of different ways of clearing all balloons with exactly $i$ darts."}},{"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\n2 2 2\r\nQQ\r\n.Q\r\n2 2 2\r\nQQ\r\n..\r\n3 3 3\r\n.Q.\r\nQQQ\r\n.Q.\r\n1 3 1\r\nQ.Q\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\n2\r\n2\r\n0\r\n1\r\n8\r\n0\r\n2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}