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

from __future__ import division
import sys

n = int(raw_input())

numbers = map(float, raw_input().split())

def getsum(x):
    global numbers
    
    globalmax = -10000
    globalmin = 10000
    
    currentmax, currentmin = numbers[0] - x, numbers[0] - x
    for i in range(1, len(numbers)):
        
        #print currentmax, globalmax, (numbers[i] - x + currentmax)
        # get max
        if (numbers[i] - x) < currentmax + numbers[i] - x :
            currentmax = currentmax + numbers[i] - x
        else:
            currentmax = (numbers[i] - x)
        
        if currentmax > globalmax:
            globalmax = currentmax
        
        
        # get min
        if numbers[i] - x > currentmin + numbers[i] - x:
            currentmin = (numbers[i] - x + currentmin)
        else:
            currentmin = (numbers[i] - x)
        
        if currentmin < globalmin:
            globalmin = currentmin
        
    #print globalmin, globalmax
    return max(abs(globalmin), globalmax)



low = -max(numbers)
hi = max(numbers)
m1 = (low+low+hi)/3
m2 = (low+hi+hi)/3

cont = 0
while abs(m1-m2) > 0.0000001:
    
    fxm1 = getsum(m1)
    fxm2 = getsum(m2)
    
    if fxm1 < fxm2:
        low = low
        hi = m2
    else:
        low = m1
        hi = hi
        
    m1 = (low+low+hi)/3
    m2 = (low+hi+hi)/3
    
    cont += 1
   
    print fxm1, fxm2


print getsum(m1)
