Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register
ACM ICPC 2018 World Finals
Language:
Necklace
 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 647 Accepted: 85 Special Judge

Description

There are N points marked on a surface, pair (xi, yi) is coordinates of a point number i. Let’s call a necklace a set of N figures which fulfills the following rules.

• The figure #i consists of all such points (x, y) that (xxi)2 + (yyi)2ri2, where ri ≥ 0.
• Figures #i and #(i + 1) intersect (1 ≤ i < N)
• Figures #1 and #N intersect
• All the rest pairs of figures do not intersect.

Write a program which takes points and constructs a necklace.

Input

The first line of the input contains one integer number N (2 ≤ N ≤ 100). Each of the next N lines contains two real numbers xi, yi (1 000 ≤ xi, yi ≤ 1 000), separated by one space. It is guaranteed that at least one necklace exists.

Output

The output has to contain N lines. A line #i contains real number ri, (0 ≤ ri < 10 000). To avoid potential accuracy problems, a checking program uses the following rules.

• Figures #i and #j definitely do not intersect if (ri + rj) ≤ dij − 10−5
• Figures #i and #j definitely intersect if (dij + 10−5) ≤ (ri + rj).
• The case when dij − 10−5 < (ri + rj) < dij + 10−5 is decided in favour of a contestant.
• dij equals sqrt((xi − xj)2 + (yi − yj)2) in the rules above.

Sample Input

```4
0 0
10 0
10 10
0 10```

Sample Output

```7
7
7
7```

Source

Northeastern Europe 2004, Western Subregion

[Submit]   [Go Back]   [Status]   [Discuss]