{"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\"\u003eThere is a sequence $A$ which contains $k$ integers.\u003cbr\u003eNow we define $f\\left(m\\right)$ is the number of different sequence $C$ that satisfies for $i$ from $1$ to $k$:\u003cbr\u003e1. If $A_{i} \u003d -1$, $C_{i}$ can be any integer in the range of $[0, m)$.Otherwise $C_{i} \u003d A_{i} \\pmod m$\u003cbr\u003e2. $\\sum\\limits_{i \u003d 1} ^{k} C_{i}x_{i} \\equiv 1 \\pmod m$($x_{i}$ are variables) have a solution in the range of integer.\u003cbr\u003e \u003cbr\u003eCalculate the answer of $\\sum\\limits_{m \u003d 1} ^{n} f(m) \\pmod{10^9+7}$.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains only one integer $T ( T \\leq 100)$, which indicates the number of test cases. \u003cbr\u003eFor each test case, the first line contains two integers $k$ and $n$.($1 \\leq k \\leq 50, 1 \\leq n \\leq 10^9$)\u003cbr\u003eThe second line contains $k$ integers: $A_{1}, A_{2} \\dots A_{k}(-1 \\leq A_{i} \\leq 10^9)$\u003cbr\u003eThere are at most $10$ test cases which satisfies $n \\geq 10^6$"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output one line \"Case #x: y\", where x is the case number (starting from 1) and y is the answer after mod 1000000007 ($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\n5 10\r\n-1 -1 8 -1 -1\r\n3 20\r\n-1 6 18\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eCase #1: 24354\r\nCase #2: 140\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}