#include <bits/stdc++.h>
using namespace std ;
const int MAX = 1e6 + 10 ;
int x[MAX] , y[MAX] ;
int n , l;
double a , b , now;
bool check(double radius)
{
now = 0.00 ;
for(int i = 0 ; i < n ; ++i)
{
a = sqrt(radius * radius - ((-y[i] * 1ll) * (-y[i] * 1ll))) + x[i] * 1ll ;
b = -sqrt(radius * radius - ((-y[i] * 1ll) * (-y[i] * 1ll))) + x[i] * 1ll ;
if(a > b)
swap(a , b) ;
if(a <= now)
now = max(now , b) ;
}
return (now >= l) ;
}
int main()
{
ios_base::sync_with_stdio(0) ;
cin.tie(0) ;
cin>>n>>l ;
for(int i = 0 ; i < n ; ++i)
cin>>x[i]>>y[i] ;
double low = 0.000 , high = 1e9 ;
double ans = high ;
for(int i = 0 ; i < 40 ; ++i)
{
double mid = (low + high) / 2.00 ;
if(check(mid))
ans = mid , high = mid ;
else
low = mid ;
}
return cout<<fixed<<setprecision(6)<<ans<<"\n" , 0 ;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |