#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset;
#define REP(i, a, b) for (ll i = (a); i < (b); i++)
#define FOR(i, x) for (auto &i : x)
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define IMAX INT_MAX
#define IMIN INT_MIN
#define LMAX LONG_LONG_MAX
#define LMIN LONG_LONG_MIN
#define MOD 1000000007
#define SIR 1000000009
vll x_coords, limits;
long double maximum(pll s, ll idx) {
    long double len = (x_coords[idx] - s.ss);
    long double men = 4 * s.ff;
    return ((len * len) / (men));
}
int main() {
    ll n;
    cin >> n;
    x_coords = vll(n);
    limits = vll(n);
    REP(i, 0, n) {
        cin >> x_coords[i] >> limits[i];
    }
    vector<long double> res(n);
    stack<pll> s;
    REP(i, 0, n) {
        long double rad = limits[i];
        while (!s.empty()) {
            rad = min(rad, maximum(s.top(), i));
            if (rad >= s.top().ff) {
                s.pop();
            } else {
                break;
            }
        }
        s.push({rad, x_coords[i]});
        res[i] = rad;
    }
    cout << fixed << setprecision(3);
    FOR(rad, res) cout << rad << '\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... |