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

#include<bits/stdc++.h>
#pragma GCC optimize "trapv"
#define ll                 long long int
#define mod                998244353
#define pi                 3.14159265358979323846264338327950288419716939937510
#define setbit(x)          __builtin_popcountll(x)
#define db                 long double
#define pp(x)              pair<x,x>
#define ff                 first
#define ss                 second
#define FIO                ios_base::sync_with_stdio(false); cin.tie(NULL);
#define tc                 ll tc; cin>>tc; for(ll number = 1 ; number <= tc ; number ++ )
#define vv(x)              vector<x>
#define pb                 push_back
#define pob                pop_back
#define pf                 push_front
#define pof                pop_front
#define endl               "\n"
#define pq                 priority_queue
#define dbg(x)             { cout<< #x << ": " << (x) << endl; }
#define dbg2(x,y)          { cout<< #x << ": " << (x) << " , " << #y << ": " << (y) << endl; }
#define bp                 ll kkk; cin >>kkk;
#define dbgArr(a,n)        cout<<"Array "<<#a<<endl; for(ll i=0 ; i<n ; i++) cout<<a[i]<<" "; cout<<endl;
#define maxE(a,n)          *max_element(a,a+n);
#define minE(a,n)          *min_element(a,a+n);
#define SZ(x) (ll)(x.size())
#define forn(i,s,n)        for(ll i=s ; i<n ; i++)
#define fornr(i,e,s)       for(ll i=e-1 ; i>=s ; i--)
#define arr1(a,n)          for(ll i=1;i<=n;i++){ cin>>a[i]; }
#define file freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)
#define print cout<<"Case #"<<number<<": "
#define all(x) x.begin(), x.end()
ll power(ll x, ll b) {ll p = 1;while (b > 0) {if(b&1) {p = p * x; p %= mod;} b >>= 1; x *= x; x %= mod;} return p % mod;}
std::vv(ll) fact;
using namespace std;

void fact_pre(ll n = 1100000) {fact.resize(n, 1); for(ll i=2; i<n; i++) fact[i] = (fact[i-1]*i) %mod;}
ll ncr(ll n, ll r) {if(r > n) return 0; return (fact[n] * power((fact[n-r] * fact[r]) %mod, mod-2))%mod;}
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
ll rng(ll lim, ll s=0) { uniform_int_distribution<ll> uid(s, lim - 1); return uid(rang); }

# define INF 1e15

struct ppp{
    ll ff, ss, tt;
};

struct lex_compare {
    bool operator() (ppp p1, ppp p2){
        if(p1.ff == p2.ff){
            if(p1.ss == p2.ss){
                return p1.tt < p2.tt;
            }
            return p1.ss < p2.ss;
        }else{
            return p1.ff < p2.ff;
        }
    }
};

ll N;


ll bs(vv(pp(ll)) &arr, ll c){
    ll l = -1, r = arr.size();
    while(r-l > 1){
        ll mid = (r+l)/2;
        if(arr[mid].ff <= c){
            l = mid;
        }else{
            r = mid;
        }
    }
    return l;
}

db kadanemin(vv(ll) &arr, db x, ll n){
    db ans = 0;
    db sum = 0;
    forn(i, 0, n){
        sum += (arr[i]-x);
        ans = min(sum ,ans);
        if(sum > 0){
            sum = 0;
        }
    }
    return abs(ans);
}

db kadanemax(vv(ll) &arr, db x, ll n){
    db ans = 0;
    db sum = 0;
    forn(i, 0, n){
        sum += (arr[i]-x);
        ans = max(sum ,ans);
        if(sum < 0){
            sum = 0;
        }
    }
    return ans;
}

db check(db x, vv(ll) &arr, ll n){
    db ans = 0;
    ans = max(ans, kadanemax(arr, x, n));
    ans = max(ans, kadanemin(arr, x, n));
    return ans;
}

void solve(){
    ll n ; cin >> n;;
    vv(ll) arr(n); forn(i, 0, n) cin >> arr[i];
    db eps = 0.0000001;
    db l = -10000, r = 1e4;
    db ans = LLONG_MAX;
    while(r-l> eps){
        db mid1 = l + (r-l)/3;
        db mid2 = l + ( 2*(r-l) )/3;
        db c1 = check(mid1, arr, n);
        db c2 = check(mid2, arr, n);
        ans = min(ans, min(c1,c2));
        if(c1 < c2){
            r = mid2-eps;
        }else{
            l = mid1+eps;
        }
    }
    cout << fixed << setprecision(9) << ans << endl;
    return ;
}

int main(){
    FIO;
    ll t; t = 1;
    while(t--)
    solve();

    return 0;
}
