#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ins insert
//cout<<fixed<<setprecision(3); 3 decimalke brez fixed pa 3 zanesljiva mesta
const int MAXN=1e6+3;
const long long linf=1e18;
const int inf=1e9;
const int mod=998244353;;
void solve(){
int n;cin>>n;
vector<pair<int,long double>>a(n);
stack<pair<int,long double>>last;
for(int i=0;i<n;i++){
cin>>a[i].first>>a[i].second;
}
vector<long double>radij;
radij.pb(a[0].second);
last.push(a[0]);
for(int i=1;i<n;i++){
long double max_r=(a[i].first-last.top().first)*(a[i].first-last.top().first)/(4*last.top().second);
while(!last.empty()&&a[i].second>=last.top().second){
last.pop();
max_r=(a[i].first-last.top().first)*(a[i].first-last.top().first)/(4*last.top().second);
}
radij.pb(min(max_r,a[i].second));
last.push({a[i].first,min(max_r,a[i].second)});
}
for(auto el:radij){cout<<fixed<<setprecision(4)<<el<<endl;}
}
int main(){
std::ios::sync_with_stdio(false);
std::cin.tie(NULL);
int t=1;
while(t--) solve();
}
# | 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... |