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

import sys

def run(mid, a):
    ans1 = a[0];
    ans2 = a[0];
    x = a[0];
    y = a[0];
    for i in range (1, len(a)):
        val = a[i];
        if(x < 0):
            x = val - mid;
        else:
            x = x + (val - mid);
        if( ans1 < x ):
            ans1 = x;
        if(y < 0):
            y = mid - val;
        else:
            y = y + mid - val;
        if( ans2 < y ):
            ans2 = y;
    if( ans1 < 0 ):
        ans1 = - ans1;
    if( ans2 < 0 ):
        ans2 = - ans2;
    if( ans1 < ans2 ):
        return ans2;
    return ans1;
n = map(int, input());
a = list(map(int, input().split()));
eps = 1e-9;
ans = 20000000000;
lft = -10000;
rht = 10000;
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);
