题号:NC232892
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
Special Judge, 64bit IO Format: %lld
题目描述
Nearest point is a classical problem in computational geometry. Given a set

of

points

is the nearest point of pi if
%20j%20%5Cneq%20i)
, and
)
for any other point
)
, where
)
is defined as
%5E2%20%2B%20(p_1.y%20%E2%88%92%20p_2.y)%5E2%7D)
in a

space.
Calculating the neatest point is known to be difficult. Therefore, there are many heuristic methods proposed. The following describes one of these algorithms:
• Step1: A random angle

is uniformly selected from range
)
.
• Step2: All points in

are rotated

counterclockwise centered on the origin
)
.
• Step3: For each point

, the algorithm takes the point that is closest to

on the

., the point
)
that minimizes

. If there are multiple such points, the point with the smallest index will be selected.
For example, suppose there are three points
)
,
)
, and
)
in set

.
1. When

is selected as 0, the coordinates of these three points after the rotation are
%2C(3%2C%203)%2C(0%2C%202))
, respectively, and thus the nearest points to

found by the algorithm are

, respectively.
2. When

is selected as

, the coordinates of these three points after the rotation are
%2C(0%2C%203%20%5Csqrt%202)%2C(%E2%88%92%20%5Csqrt%202%2C%20%5Csqrt%202))
, and thus the nearest points are

, respectively.
Now, given the

points

in

, your task is to output an

matrix

, where

represents the probability for the algorithm to take

as the nearest point of

.
输入描述:
The first line contains a single integer
)
, the number of points in S.
Then

lines follow, each line contains two integers

and
)
.
The input guarantees that each given point is different from the other
输出描述:
Output

lines, each with

float numbers. The

number in the

line represents the probability for

to be returned as the nearest point by the algorithm.
Note that for each

, the

number in the

line is always 0.
Your result is judged as correct if for each probability, either the relative error or the absolute error comparing with the standard output is at most

.
Note: The space at the end of a line will be ignored.
示例1
输出
复制
0.00000000 0.29516721 0.70483279
0.57797916 0.00000000 0.42202084
0.75000004 0.24999996 0.00000000
示例2
输出
复制
0.00000000 1.00000000 0.00000000
1.00000000 0.00000000 0.00000000
0.00000000 1.00000000 0.00000000
示例3
输入
复制
5
8 10
9 75
810 9
7 5
810 975
输出
复制
0.00000000 0.00909209 0.00396988 0.98570675 0.00123125
0.87050435 0.00000000 0.05126782 0.05576056 0.02246725
0.01389151 0.27660743 0.00000000 0.27929864 0.43020240
0.98698866 0.00782892 0.00395991 0.00000000 0.00122250
0.00558540 0.30017070 0.59898322 0.09526066 0.00000000
说明
810975,萌新怎么听不懂!922768,萌新怎么不知道?