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

def get_max(b):
    ans = b[0];
    x = b[0];
    for i in range(1, len(b)):
        if(x >= 0):
            x = x + b[i];
        else:
            x = b[i];
        if( x >= ans ):
            ans = x;
    if( ans < 0 ):
        ans = - ans;
    return ans;

def run(x, a):
    b = [];
    for val in a:
        b.append(val - x);
    ans1 = get_max(b);
    for i in range(0, len(b)):
        b[i] = - b[i];
    ans2 = get_max(b);
    if ans1 <= ans2:
        return ans2;
    return ans1;

n = map(int, input());
a = list(map(int, input().split()));
eps = 1e-9;
ans = 20000000000;
lft = 0;
rht = 1000000000;
while (lft + eps < rht):
    mid1 = 0.5 * (lft + rht);
    mid2 = 0.5 * (mid1 + rht);
    ans1 = run(mid1, a);
    ans2 = run(mid2, a);
    if ans1 <= ans2:
        ans = ans1;
        rht = mid2 - eps;
    else:
        ans = ans2;
        lft = mid1 + eps;
print (ans);
