{"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\"\u003eFrog has just learned how to multiply two numbers. Now he wants to do some exercise.\u003cbr\u003e\u003cbr\u003eHe wrote a string on the paper, which only contains digits and a single $\\times$ as the operator. If the $\\times$ appears at the front or the end of the string, he regards the result as \u003cb\u003ezero\u003c/b\u003e, otherwise he does the calculation as $a\\ normal\\ multiplication$.\u003cbr\u003e\u003cbr\u003eAfter some play, he wonders a new problem: for a initial string, each time he randomly choose two characters and swap their positions. He will do this again and again, say for $K$ times, he wants to know the expected calculation result for the newest string that he gets.\u003cbr\u003e\u003cbr\u003eIt can be shown that their can be $\\binom{n}{2} ^ K$ ways(Same as $\\left(C_{n}^{2}\\right)^K$) for the whole swap operations, so if the expected result is x, you need to output $x \\times \\binom{n}{2} ^ K$ as an integer.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"First line contains an integer $T$, which indicates the number of test cases.\u003cbr\u003e\u003cbr\u003eEvery test case begins with an integers $K$, which is the numbers of times the Frog can swap characters.\u003cbr\u003e\u003cbr\u003eThe second line of each test case contains the string Frog plays with, which only contains digits and \u003cb\u003eexactly one\u003c/b\u003e multiplication operator, written as \u0027$*$\u0027.\u003cbr\u003e\u003cbr\u003e$\\cdot$ $1 \\leq T \\leq 100$.\u003cbr\u003e\u003cbr\u003e$\\cdot$ the string\u0027s length is $L$.\u003cbr\u003e\u003cbr\u003e$\\cdot$ for 70% data, $1 \\leq L \\leq 10$ and $0 \\leq K \\leq 5$.\u003cbr\u003e\u003cbr\u003e$\\cdot$ for 95% data, $1 \\leq L \\leq 20$ and $0 \\leq K \\leq 20$. \u003cbr\u003e\u003cbr\u003e$\\cdot$ for 100% data, $1 \\leq L \\leq 50$ and $0 \\leq K \\leq 50$."}},{"title":"Output","value":{"format":"HTML","content":"For every test case, you should output \"\u003cb\u003eCase #x: y\u003c/b\u003e\", where $x$ indicates the case number and counts from $1$ and $y$ is the result.\u003cbr\u003e\u003cbr\u003eBecause $y$ could be very large, just mod it with $10^9 + 7$."}},{"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\n1\r\n1*2\r\n2\r\n1*2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 2\r\nCase #2: 6\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}