10
-405 -230 252 -393 -390 -259 97 163 81 -129
 3
10000 -10000 10000
 1
-10000
 20
-16 -23 29 44 -40 -50 -41 34 -38 30 -12 28 -44 -49 15 50 -28 38 -2 0

702.333333333333712
 10000.000000000016371
 0.000000000000000
 113.875000000000043

// #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("avx,avx2,sse,sse2")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
#define ll long long
#define ld long double
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define mp make_pair
#define random mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
 
template <typename T> using oset = tree <pair <T, T>, null_type, less <pair <T, T>>, rb_tree_tag, tree_order_statistics_node_update>;

template <typename Container>
void Print(Container& container, int starting) {
    auto Start = container.begin() + starting, End = container.end();
    while (Start != End) cout << *(Start++) << " ";
    cout << '\n';
}
 
template <typename T>
void print(T&& t) {cout << t << '\n';}
 
template <typename T, typename... Args>
void print(T&& t, Args&&... args) {
    cout << t << " ";
    print(forward<Args>(args)...);
}

const ld eps = 1e-9;

inline void solve() {
    int n;
    cin >> n;
    vector <ld> a(n);
    ld l = 1e9, r = -1e9, m1, m2, f1, f2;
    auto f = [&](vector <ld>& v, ld x) -> ld {
        int n = v.size();
        ld arr[n + 1];
        arr[0] = 0;
        ld MIN = 0, MAX = 0, ans = 0;
        for (int i = 0; i < n; ++i) {
            arr[i + 1] = v[i] - x;
            arr[i + 1] += arr[i];
        }
        for (int i = 1; i <= n; ++i) {
            ans = max(ans, abs(arr[i] - MIN));
            ans = max(ans, abs(arr[i] - MAX));
            MIN = min(MIN, arr[i]);
            MAX = max(MAX, arr[i]);
        }
        return ans;
    };
    for (auto& x : a) {
        cin >> x;
        l = min(l, x);
        r = max(r, x);
    }
    while (r - l > eps) {
        m1 = l + (r - l) / 3.0;
        m2 = r - (r - l) / 3.0;
        f1 = f(a, m1);
        f2 = f(a, m2);
        if (f1 < f2) {
            r = m2;
        } else {
            l = m1;
        }
    }
    cout << fixed << setprecision(10);
    print(f(a, l));
}
 
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int T = 1;
    // cin >> T;
    for (int test = 1; test <= T; ++test) {
        // cout << "Case #" << test << ": ";
        solve();
    }
}