P9405 [POI 2020/2021 R3] Interplanetary Communication / Komunikacja międzyplanetarn

Background

Translated from [XXVIII Olimpiada Informatyczna - III etap](https://sio2.mimuw.edu.pl/c/oi28-3/dashboard/) [Komunikacja międzyplanetarn](https://szkopul.edu.pl/problemset/problem/43LcdhShos7i99wnVNtQYUUK/statement/)。 d2t1。

Description

There are $n$ 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\%$ is accepted。

Input Format

The first line contains an integer $n$。 The next $n$ lines each contain two integers $x, y$, representing the coordinates of a point。

Output Format

Output $n$ lines, each containing one real number, representing the answer for each point。

Explanation/Hint

Constraints: for all testdata, $2 \leq n \leq 100000$, $-10^6 \leq x, y \leq 10^6$。 | Subtask ID | Additional Constraints | Score | | :----------: | :----------: | :----------: | | 1 | $n \leq 1000$ | 4 | | 2 | All points are collinear | 16 | | 3 | The point coordinates are random, and a relative error not exceeding $2\%$ is accepted | 20 | | 4 | | 60 | Translated by ChatGPT 5