#include<bits/stdc++.h>
using namespace std;
#define ld long double
int main(){
cout<<fixed<<setprecision(3);
int n; cin>>n;
vector<long double> ans;
stack<pair<int,long double>> ms;
for(auto i = 0; i < n; i++){
int x,r; cin>>x>>r;
ld r_ = r;
while(ms.size()){
r_ = ((ld)(x - ms.top().first)*(ld)(x - ms.top().first))/((ld)4*ms.top().second);
if(r_ < r) ms.pop();
else break;
}
r_ = min(r_, r+0.000l);
ms.push({x,r_});
cout<<ms.top().second<<'\n';
}
}
# | 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... |