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 max_sum(x):
    ans = now = 0
    for v in a:
        now += v - x
        now = max(now, 0)
        ans = max(ans, now)
    return ans

def min_sum(x):
    ans = now = 0
    for v in a:
        now += v - x
        now = min(now, 0)
        ans = min(ans, now)
    return ans


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

l = min(a)
r = max(a)
for _ in range(50):
    x = (r + l) / 2
    A = abs(max_sum(x))
    B = abs(min_sum(x))
    if A < B:
        r = x
    else:
        l = x
print(max(A, B))
