{"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\"\u003eWe consider a sequence A with p float-point numbers denoted by $a_0,a_1,...,a_{p-1}$ where p is a prime number. To simplify our problem, we guarantee that p must be 13, 103 or 100003.\u003cbr\u003eTo make a decomposition for this sequence, we define the kernal functions \u003cbr\u003e$$r(h,k)\u003d2^{sin^{3}(2\\pi \\frac{hk}{p})}$$\\\\Therefore we can get a new sequence B \u003d {$b_0,b_1,\u0026nbsp;\u0026nbsp;... , b_{p-1}$} tranformed from the original sequence A where \\\\$$b_{k}\u003d\\sum_{h\u003d0}^{p-1}a_{h}*r(h,k)$$\u003cbr\u003eYour mission is to calculate the new sequence B.\u003cbr\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line is the number of test cases. Each test case contains two lines. The first line contains an integer p. The second line contains p float-point numbers corresponding to the sequence A."}},{"title":"Output","value":{"format":"HTML","content":"For each test case, output p float-point numbers rounded to three decimal places in one line corresponding to the sequence B."}},{"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\u003e13\r\n7 0 0 0 0 0 0 0 0 0 0 0 0\r\n13\r\n1 2 3 4 5 6 7 8 9 10 11 12 13\r\n13\r\n11 7 7 7 7 7 7 7 7 7 7 7 7\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e7.000 7.000 7.000 7.000 7.000 7.000 7.000\r\n7.000 7.000 7.000 7.000 7.000 7.000\r\n91.000 85.477 92.015 93.543 91.049 99.763\r\n98.551 98.517 97.304 106.018 103.525\r\n105.053 111.590\r\n95.000 102.032 102.032 102.032 102.032\r\n102.032 102.032 102.032 102.032 102.032\r\n102.032 102.032 102.032\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cb\u003ePay attention, please.\u003c/b\u003e You may notics that p we provided must be a prime number in {13,103,100003}.\u003cbr\u003eIn order to avoid misleading, we emphasize that our standard algorithm only considers the natures of prime numbers. You may need to do some extra easy calculations offline for specified input 13,103 and 100003 to simplify your program."}}]}