s450. Problem A: Cosmic Barrier
Tags : Zaim ICPC mock
Accepted rate: 2人/ 4人 ( 50%) [非即時]
評分方式:
Tolerant

最近更新 : 2026-06-16 11:22

Content

A team of space archaeologists has discovered a cluster of $N$ ancient energy monoliths on a two-dimensional planetary plane. The position of the $i$-th monolith is given by integer coordinates $(x_i, y_i)$. To conduct research safely without triggering an energy chain reaction, they need to deploy a straight-line laser barrier $L$.
Due to the unstable gravitational fluctuations at the coordinate origin $(0,0)$, the barrier $L$ cannot be placed too close to the center. Specifically, the perpendicular distance from the origin $(0,0)$ to the line $L$ must be at least $R$.
The hazard level of the barrier setup is defined as the maximum perpendicular distance from any of the $N$ monoliths to the line $L$. The archaeologists want to find a valid line $L$ that minimizes this hazard level. Can you help them compute the minimum possible hazard level?

Input

The first line contains two integers $N$ and $R$ ($3 \le N \le 10^5$, $0 \le R \le 10^6$) — the number of monoliths and the minimum allowed distance from the origin to the barrier.
Each of the next $N$ lines contains two integers $x_i$ and $y_i$ ($-10^6 \le x_i, y_i \le 10^6$) — the coordinates of the $i$-th monolith.
It is guaranteed that the monoliths are not all collinear, and no monolith is located exactly at the origin.

Output

Output a single floating-point number representing the minimum possible hazard level. Your answer will be accepted if its absolute or relative error does not exceed $10^{-9}$.

Sample Input #1
4 0
2 2
-2 2
-2 -2
2 -2
Sample Output #1
2.0000000000
Sample Input #2
4 3
2 2
-2 2
-2 -2
2 -2
Sample Output #2
5.0000000000
測資資訊:
記憶體限制: 512 MB
不公開 測資點#0 (5%): 0.5s , <1K
不公開 測資點#1 (5%): 0.5s , <1K
不公開 測資點#2 (5%): 0.5s , <10M
不公開 測資點#3 (5%): 0.5s , <10M
不公開 測資點#4 (5%): 0.5s , <10M
不公開 測資點#5 (5%): 0.5s , <10M
不公開 測資點#6 (5%): 0.5s , <10M
不公開 測資點#7 (5%): 0.5s , <10M
不公開 測資點#8 (5%): 0.5s , <10M
不公開 測資點#9 (5%): 0.5s , <10M
不公開 測資點#10 (5%): 0.5s , <10M
不公開 測資點#11 (5%): 0.5s , <10M
不公開 測資點#12 (5%): 0.5s , <10M
不公開 測資點#13 (5%): 0.5s , <10M
不公開 測資點#14 (5%): 0.5s , <10M
不公開 測資點#15 (5%): 0.5s , <10M
不公開 測資點#16 (5%): 0.5s , <10M
不公開 測資點#17 (5%): 0.5s , <10M
不公開 測資點#18 (5%): 0.5s , <10M
不公開 測資點#19 (5%): 0.5s , <10M
Hint :
Tags:
Zaim ICPC mock
出處:
[管理者: chenwei98050 ... (陳維(Z)) ]

Status Forum 排行

ID User Problem Subject Hit Post Date
沒有發現任何「解題報告」