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
n = int(sys.stdin.readline())
a = [int(x) for x in sys.stdin.readline().split()]

eps = 1e-6

def f(x):
    mx = a[0] - x
    ts = 0.0
    for i in range(0, n):
        ts = max(ts + a[i] - x, a[i] - x)
        mx = max(ts, mx)

    mn = a[0] - x
    ts = 0.0
    for i in range(0, n):
        ts = min(ts + a[i] - x, a[i] - x)
        mn = min(ts, mn)

    return max(abs(mx), abs(mn))

l = -10000
r = 10000
fl = f(l)
fr = f(r)
while abs(fl - fr) > eps:
    m1 = l + (r - l) / 3
    m2 = l + (r - l) / 3 * 2
    f1 = f(m1)
    f2 = f(m2)
    if f1 > f2:
        l = m1
        fl = f1
    else:
        r = m2
        fr = f2

print(f(l))