#P3198. [HNOI2008] 遥远的行星
[HNOI2008] 遥远的行星
Description
There are planets on a line; planet is located at position . Planet is affected by the force from planet if and only if . In this case, the magnitude of the force on is .
Here is a very small constant, so intuitively each planet is only affected by planets that are far away. Compute the force on each planet. The answer is accepted if the relative error does not exceed 5%.
Input Format
The first line contains an integer and a real number .
The next lines contain the masses of the planets.
Output Format
Output lines, the force on each planet in order.
5 0.3
3
5
6
2
4
0.000000
0.000000
0.000000
1.968750
2.976000
Hint
.
.
.
Translated by ChatGPT 5
京公网安备 11011102002149号