#include <bits/stdc++.h>
#define fi first
#define se second
#define int long long
using namespace std;
using ll = long long;
using ii = pair<ll, ll>;
using pii = pair<int,ii>;
using aa = array<int,3>;
const int N = 2e5+5;
const int INF = 1e9;
const int MOD = 1e9+7;
int n;
pair<long double,long double> p[N];
stack<int> st;
signed main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin >> n;
for (int i = 1; i <= n; i++){
cin >> p[i].fi >> p[i].se;
while (!st.empty()){
int pos = st.top();
long double ans = (p[i].fi - p[pos].fi) * (p[i].fi - p[pos].fi) / (4LL * p[pos].se);
p[i].se = min(p[i].se,ans);
if (p[i].se >= p[pos].se) st.pop();
else break;
}
st.push(i);
cout << fixed << ' ' << setprecision(3) << ' ' << p[i].se << '\n';
}
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... |