QOJ.ac

QOJ

Limite de temps : 10.0 s Limite de mémoire : 1024 MB Points totaux : 100

#17608. Escape

Statistiques

A thief has robbed a bank located at the origin of the coordinate system and now wants to escape while being chased by $n$ police officers. The thief will choose a direction and move in that direction in a straight line at a constant speed $V$. Each police officer starts at some point in the coordinate system and can move in any direction, also in a straight line at the same constant speed $V$. If at any moment a police officer is at the same point as the thief, the thief is caught.

The initial positions of the police officers are given. Determine if it is possible for the thief to escape the police. That is, we are interested in whether the thief can choose a direction such that no police officer can catch them. If they cannot escape, determine the maximum possible distance the thief can travel before being caught by some police officer. We assume that the police officers know the direction the thief has chosen and that they move to catch the thief as quickly as possible.

Input

The first line contains a natural number $n$ — the number of police officers. In the $j$-th of the following $n$ lines, there are two integers $x_j$ and $y_j$ — the initial coordinates of the $j$-th police officer. All police officers will be at distinct positions, and none will be located at the origin.

Output

If it is possible for the thief to escape, print $-1$. Otherwise, print the requested maximum possible distance. An absolute or relative error of $10^{-5}$ will be tolerated.

Subtasks

Subtask Points Constraints
1 20 $1 \le n \le 100, -10 \le x_j, y_j \le 10$
2 30 $1 \le n \le 3\,000, -100 \le x_j, y_j \le 100$
3 50 $1 \le n \le 100\,000, -1000 \le x_j, y_j \le 1000$

Examples

Input 1

4
4 4
-4 4
-4 -4
4 -4

Output 1

4

Input 2

3
3 0
-3 1
-3 -1

Output 2

9.617692030835672

Input 3

2
1 1
0 1

Output 3

-1

Note

Explanation of the first example: One optimal strategy is for the thief to flee in the positive direction of the $y$-axis. In that case, the first police officer catches them after they have traveled a distance of 4 units.

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.