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 main():
	input()
	a = list(map(int, input().split()))
	
	def f(a):
	    maxend = maxnow = 0
	    for x in a:
	        maxend = max(0, maxend + x)
	        maxnow = max(maxnow, maxend)
	    return maxnow
	
	f1 = lambda x: f(i - x for i in a)
	f2 = lambda x: f(x - i for i in a)
	Max = max(abs(i) for i in a)
	L, R = -Max, Max
	eps = 10 ** -8
	for i in range(100):
	    m = (L + R) / 2
	    v1, v2 = f1(m), f2(m)
	    if abs(v1 - v2) < eps:
	        break
	    if v1 > v2:
	        L = m
	    else:
	        R = m
	
	print(v1)
main()