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 poorness(a,x):
    v1 = a[0]-x
    v2 = -a[0]+x
    r = abs(a[0])

    for i in range(1, len(a)):
        if (v1 < 0):
            v1 = 0
        if (v2 < 0):
            v2 = 0
        v1 += a[i]-x
        v2 -= a[i]-x
        r = max(r, v1, v2)
    return r

def main():
    eps = 1e-6

    n = int(input())
    a = [int(x) for x in input().split(' ')]

    l = -20000
    r = 20000
    for i in range(100):
        m1 = l + (r - l) / 3
        m2 = r - (r - l) / 3
        k1 = poorness(a, m1)
        k2 = poorness(a, m2)
        #print('Round ' + str(i) + ': k1 = ' + str(k1) + '    k2 = ' + str(k2))
        if abs(k1-k2) < eps:
            break
        if k1 < k2:
            r = m2
        else:
            l = m1
    #print(str(l) + ' ' + str(r) + ' ' + str(m1) + ' ' + str(m2))
    print(poorness(a, (m1+m2)/2))

main()
