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>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
#define PI                      3.1415926535897932384626
#define MOD                     998244353
#define int                     long long int
#define fi                      first
#define se                      second
#define pq                      priority_queue
#define pb                      push_back
#define endl                    '\n'
#define all(x)                  x.begin(),x.end()
#define pii                     pair<int,int>
#define fill(x,y)               memset(x,y,sizeof(x));
#define rep(x,y,z)              for(int x = y; x < z; ++x)
#define repr(x,y,z)             for(int x = y; x > z; --x)
#define fast                    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef tree<pii,null_type,less<pii>,rb_tree_tag,
tree_order_statistics_node_update> ordered_set;



template<typename T> T pow(T a,T b, int m){T ans=1; while(b>0){ if(b%2==1) ans=(ans*a)%m; b/=2; a=(a*a)%m; } return ans%m; }
template<typename T> void swap(T &a,T &b){T temp = a;a = b;b = temp;return ;}

const int N = 2e5+2;
int a[N];
int n;
long double out = 1e18;
long double f(double x)
{
    long double sum = 0,ans = 0;
    rep(i,0,n)
    {
        sum += (a[i] - x);
        if(sum < 0)
        {
            sum = 0;
        }    
        ans = max(ans,sum);
    }
    sum = 0;
    rep(i,0,n)
    {
        sum += (a[i] - x);
        if(sum > 0)
            sum = 0;
        ans = max(ans,abs(sum));
    }
    out = min(out,ans);
    return ans;
}

signed main()
{
    cin >> n;
    rep(i,0,n) cin >> a[i];
    long double lo = -1e6, hi = +1e6 , eps = 1e-7;
    while(hi - lo > eps)
    {
        long double a = lo + (hi - lo)/3.0000000 ;
        long double b = hi - (hi - lo)/3.00000000;
        long double x = f(a);
        long double y = f(b); 
        if(x < y)
        {
            hi = b;
        }
        else if(x > y)
        {
            lo = a;
        }
        else
        {
            lo = a;
            hi = b;
        }
    }
    cout << setprecision(10) << out << endl;
} 