QOJ.ac

QOJ

时间限制: 3 s 内存限制: 512 MB 总分: 100

#7296. Force

统计

Given $n$ numbers $q_i$, the definition of $F_j$ is given as follows:

$$F_j = \sum_{i < j} \frac{q_i q_j}{(i - j)^2} - \sum_{i > j} \frac{q_i q_j}{(i - j)^2}$$

Let $E_i = F_i / q_i$. Calculate $E_i$.

Input

The input contains an integer $n$, followed by $n$ lines, each containing a number, where the $i$-th line represents $q_i$.

Output

The output contains $n$ lines, where the $i$-th line outputs $E_i$. The error compared to the standard answer should not exceed $1e-2$.

Examples

Input 1

5 
4006373.885184 
15375036.435759 
1717456.469144 
8514941.004912 
1410681.345880

Output 1

-16838672.693 
3439.793 
7509018.566 
4595686.886 
10903040.872

Constraints

For 30% of the data, $n \le 1000$. For 50% of the data, $n \le 60000$. For 100% of the data, $n \le 100000$, $0 < q_i < 1000000000$.

Definition of Fj

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.