|
||||||||||
New Signal DecompositionTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 653 Accepted Submission(s): 82 Problem Description We 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. To make a decomposition for this sequence, we define the kernal functions $$r(h,k)=2^{sin^{3}(2\pi \frac{hk}{p})}$$ Therefore we can get a new sequence B = {$b_0,b_1, ... , b_{p-1}$} tranformed from the original sequence A where $$b_{k}=\sum_{h=0}^{p-1}a_{h}*r(h,k)$$ Your mission is to calculate the new sequence B. Input 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. Output For each test case, output p float-point numbers rounded to three decimal places in one line corresponding to the sequence B. Sample Input
Sample Output
Hint Pay attention, please. You may notics that p we provided must be a prime number in {13,103,100003}. In 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. Source | ||||||||||
|