#P9405. [POI 2020/2021 R3] 星间通信 / Komunikacja międzyplanetarn
[POI 2020/2021 R3] 星间通信 / Komunikacja międzyplanetarn
Background
Translated from XXVIII Olimpiada Informatyczna - III etap Komunikacja międzyplanetarn。
d2t1。
Problem Description
There are points on a 2D plane。
For each point, compute the sum of its Euclidean distances to all other points。
A relative error not exceeding is accepted。
Input Format
The first line contains an integer 。
The next lines each contain two integers , representing the coordinates of a point。
Output Format
Output lines, each containing one real number, representing the answer for each point。
4
-1 0
0 0
3 3
-1 1
7.000000000000
6.656854249492
13.714776642119
6.886349517373
25
-2 -2
-2 -1
-2 0
-2 1
-2 2
-1 -2
-1 -1
-1 0
-1 1
-1 2
0 -2
0 -1
0 0
0 1
0 2
1 -2
1 -1
1 0
1 1
1 2
2 -2
2 -1
2 0
2 1
2 2
79.340412611230
68.023981606779
64.155694316737
68.023981606779
79.340412611230
68.023981606779
55.532407162959
51.265774235248
55.532407162959
68.023981606779
64.155694316737
51.265774235248
46.859106568475
51.265774235248
64.155694316737
68.023981606779
55.532407162958
51.265774235248
55.532407162959
68.023981606779
79.340412611230
68.023981606779
64.155694316737
68.023981606779
79.340412611230
见附件
见附件
Hint
Constraints: for all testdata, , 。
| Subtask ID | Additional Constraints | Score |
|---|---|---|
| 1 | 4 | |
| 2 | All points are collinear | 16 |
| 3 | The point coordinates are random, and a relative error not exceeding is accepted | 20 |
| 4 | 60 |
Translated by ChatGPT 5