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

n = input()
d = list(map(int,raw_input().split(" ")))
s = d[:]
for i in range(len(d)):
    if(i>0):
        s[i] = s[i-1] + d[i]
l = min(d)
ll = l
r = max(d)
rr = r
step = 1.0

def weak(x):
    ss = [0] + [s[i] - x*(1+i) for i in range(len(s))]
    return max(ss) - min(ss)
t = True
x = 0
while(abs(ll-rr) > 10**(-9)):
    if t:
        k = l
    else:
        k = r
    x = k + step
    if(weak(x) < weak(k)):
        if t:
            l = x
        else:
            r = x
    else:
        if t:
            rr = l
            l = ll
            r = x
        else:
            ll = r
            r = rr
            l = x
        t = not t
        step *= -0.5
x = (ll+rr)/2.0

print weak(x)