You are given a sequence of n integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>. 

Determine a real number *x* such that the weakness of the sequence *a*<sub class="lower-index">1</sub> - *x*, *a*<sub class="lower-index">2</sub> - *x*, ..., *a*<sub class="lower-index">*n*</sub> - *x* is as small as possible.

The weakness of a sequence is defined as the maximum value of the poorness over all segments (contiguous subsequences) of a sequence.

The poorness of a segment is defined as the absolute value of sum of the elements of segment.
The first line contains one integer *n* (1 ≤ *n* ≤ 200 000), the length of a sequence.

The second line contains *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (|*a*<sub class="lower-index">*i*</sub>| ≤ 10 000).
def f(x,arr):
    max1,max2 = 0,0
    s = 0
    for i in range(len(arr)):
        s+=arr[i]-x
        if s<0:
            s=0
        max1 = max(s,max1)
        
    s = 0
    for i in range(len(arr)):
        s+=x-arr[i]
        if s<0:
            s=0
        max2 = max(s,max2)
        
    return max(max1,max2)
    
def ternary(arr):
    err = 1e-9
    l = -10000
    r = 10000
    while r-l>err:
        m1 = l+(r-l)/3
        m2 = r-(r-l)/3
    
        f1 = f(m1,arr)
        f2 = f(m2,arr)
    
        if f1<f2:
            r = m2
        elif f1>f2:
            l = m1
        else:
            l,r = m1,m2
        
    print("%0.6f"%f(l,arr))
    
n = int(input())
arr = [0]*n
for i in range(n):
    arr[i] = int(input())
ternary(arr)