#P3338. [ZJOI2014] 力

    ID: 2387 远端评测题 3000ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>数学2014浙江Special Judge快速傅里叶变换 FFT

[ZJOI2014] 力

Description

Given nn numbers q1,q2,qnq_1,q_2, \dots q_n, define

$$F_j~=~\sum_{i = 1}^{j - 1} \frac{q_i \times q_j}{(i - j)^2}~-~\sum_{i = j + 1}^{n} \frac{q_i \times q_j}{(i - j)^2}$$Ei = FiqiE_i~=~\frac{F_i}{q_i}

For 1in1 \leq i \leq n, find the value of EiE_i.

Input Format

The first line contains an integer nn.

Each of the following nn lines contains a real number. The number on the (i+1)(i+1)-th line represents qiq_i.

Output Format

Output nn lines, each containing a real number. The number on the ii-th line represents EiE_i.

Your output is considered correct if it differs from the standard answer by at most 10210^{-2}.

5
4006373.885184
15375036.435759
1717456.469144
8514941.004912
1410681.345880
-16838672.693
3439.793
7509018.566
4595686.886
10903040.872

Hint

Constraints
For 30%30\% of the testdata, n1000n \leq 1000.
For 50%50\% of the testdata, n6×104n \leq 6 \times 10^4.
For 100%100\% of the testdata, 1n1051 \leq n \leq 10^5, 0<qi<1090 < q_i < 10^9.

Translated by ChatGPT 5