This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
int n;
cin >> n;
long double gx,gr,lx,lr;
for (int i=1;i<=n;i++){
long double x,r;
cin >> x >> r;
if (i == 1){
cout << setprecision(3) << fixed << r << "\n";
gx=lx=x;
gr=lr=r;
}
else
{
if ((gx-x)*(gx-x)*lr >= gr*(lx-x)*(lx-x)) gx=lx,gr=lr;
cout << setprecision(3) << fixed << min((x-gx)*(x-gx)/4.0/gr,r) << "\n";
lx=x; lr=min((x-gx)*(x-gx)/4.0/gr,r);
}
}
return 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... |