#P9405. [POI 2020/2021 R3] 星间通信 / Komunikacja międzyplanetarn

    ID: 10507 远端评测题 2000ms 256MiB 尝试: 0 已通过: 0 难度: 9 上传者: 标签>数学2020POI(波兰)Special Judge微积分其它技巧

[POI 2020/2021 R3] 星间通信 / Komunikacja międzyplanetarn

Background

Translated from XXVIII Olimpiada Informatyczna - III etap Komunikacja międzyplanetarn

d2t1。

Problem Description

There are nn points on a 2D plane。

For each point, compute the sum of its Euclidean distances to all other points。

A relative error not exceeding 0.1%0.1\% is accepted。

Input Format

The first line contains an integer nn

The next nn lines each contain two integers x,yx, y, representing the coordinates of a point。

Output Format

Output nn 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, 2n1000002 \leq n \leq 100000, 106x,y106-10^6 \leq x, y \leq 10^6

Subtask ID Additional Constraints Score
1 n1000n \leq 1000 4
2 All points are collinear 16
3 The point coordinates are random, and a relative error not exceeding 2%2\% is accepted 20
4 60

Translated by ChatGPT 5