QOJ.ac

QOJ

Time Limit: 4 s Memory Limit: 1024 MB

#19929. High-Voltage Power Line

Statistics

The infrastructure design for a newly planned city is underway. To provide a smooth and stable power supply, it has been decided to run a high-voltage power line across the city. However, because high-voltage power lines induce strong electromagnetic fields, they should be placed as far away from residential areas as possible.

Suppose the residential areas of the city are represented by $N$ points on a plane, and the high-voltage power line takes the form of a perfect straight line on this plane. Since the residential point closest to the power line is the most affected, an optimal power line must maximize the minimum straight-line distance to any residential point while crossing the city. Specifically, the power line (straight line) crossing the city means that there is at least one residential point on each side of the power line.

Write a program that calculates the optimal configuration of the high-voltage power line and prints the minimum straight-line distance to each residential point in this configuration.

Input

The following information is given through standard input. The first line contains the number of residential points in the new city, $N$ ($2 \le N \le 2,000$). Each of the following $N$ lines contains the coordinates of each residential point as two integers. The coordinates range from $-10^9$ to $10^9$, inclusive. No two residential points given in the input have the exact same coordinates.

Output

Print to standard output the minimum straight-line distance to a residential point for the optimal high-voltage line crossing the city for the given residential points, as a real number. The output is considered correct if its absolute or relative error is at most $10^{-6}$. For reference, the absolute error means $|(\text{printed value}) - (\text{correct answer})|$, and the relative error means $|(\text{printed value}) - (\text{correct answer})| / (\text{correct answer})$.

Subtasks

  • Subtask 1: Worth 14 points out of 100, and $N = 2$ or $N = 3$.
  • Subtask 2: Worth 21 points out of 100, $N \le 50$, and coordinates range from $-1,000$ to $1,000$, inclusive. In addition, no three residential points lie on a single line.
  • Subtask 3: Worth 9 points out of 100, $N \le 500$, and coordinates range from $-10^5$ to $10^5$, inclusive. In addition, no three residential points lie on a single line.
  • Subtask 4: Worth 30 points out of 100, $N \le 2,000$, and coordinates range from $-10^9$ to $10^9$, inclusive. In addition, no three residential points lie on a single line.
  • Subtask 5: Worth 26 points out of 100, with no additional constraints beyond the original constraints.

Examples

Examples

Input 1

4
0 0
1 1
0 1
1 0

Output 1

0.50000000

Examples

Input 2

10
-3 5
0 0
-1 6
0 8
8 2
4 0
7 -2
2 6
9 1
9 2

Output 2

2.66789187

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.