logo AlgoBeat OnlineJudge
登录 注册

#217316. [ICPC 2017 Nanning R] Five Dimensional Discrete Fourier Transform

内存限制:512 MiB 时间限制:6000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

The five dimensional discrete fourier transform over a complex array where and is given by:

for .

Now comes your turn. For a given real coefficient , suppose

Please calculate the value of

where means the real part of a complex number and means the absolute value of a real number.

输入格式

The first line of the input contains an integer indicating the total number of test cases. For each test case, a line contains five integers where , and a float number with at most significant digits.

输出格式

For each test case, output the value with the precision of digits.

样例

样例输入 1

5
1 1 1 1 2 9.8
1 1 1 1 4 3.14
1 2 1 2 1 8.777
2 1 1 1 2 8.777
1 2 3 2 1 20.1314

样例输出 1

0.657911
1.499989
0.398713
0.398713
0.942596