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-12

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 abs(mx), abs(mn)

l = -10000
r = 10000
while abs(l - r) > eps:
    m = (l + r) / 2
    f1, f2 = f(m)
    if f1 > f2:
        l = m
    else:
        r = m

print(f(l))