#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
int n; cin>>n;
stack<pair<int,double>>st;
for(int i=0;i<n;i++){
int x; double r; cin>>x>>r;
while(st.size()){
auto [y,r2]=st.top();
double g=1.0*(x-y)*(x-y)/(4*r2);
r=min(g,r);
if(r>=r2) st.pop();
else break;
}
cout<<fixed<<setprecision(6)<<r<<'\n';
st.push({x,r});
}
}
# | 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... |