#include <bits/stdc++.h>
using namespace std;
using ld = long double;
typedef pair<ld,ld> pll;
ld raio(ld d,ld r2){
return (d*d)/(4*r2);
}
int main() {
int N;
cin>>N;
stack<pll> stack;
for(int _ = 0;_!=N;++_){
ld x,r;
cin>>x>>r;
while(stack.size()){
ld l = raio(stack.top().first-x,stack.top().second);
l=min(l,r);
if(l>=stack.top().second){
stack.pop();
r=min(l,r);
}else {
r=l;
break;
}
}
stack.push({x,r});
cout<<fixed<<setprecision(3)<<r<<"\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... |