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).
import sys
readline=sys.stdin.readline

def Tersect_Float(L,R,f,eps=1e-12,cnt=0,maximize=False):
    f_L,f_R=f(L),f(R)
    if cnt:
        for _ in range(cnt):
            l,r=(2*L+R)/3,(L+2*R)/3
            f_l,f_r=f(l),f(r)
            if maximize:
                if f_l>=f_r>=f_R:
                    R=r
                    f_R=f_r
                elif f_L<=f_l<=f_r:
                    L=l
                    f_L=f_l
                else:
                    L,R=l,r
                    f_L,f_R=f_l,f_r
            else:
                if f_l<=f_r<=f_R:
                    R=r
                    f_R=f_r
                elif f_L>=f_l>=f_r:
                    L=l
                    f_L=f_l
                else:
                    L,R=l,r
                    f_L,f_R=f_l,f_r
    else:
        while (R-L)/max(L,R,1)>=eps:
            l,r=(2*L+R)/3,(L+2*R)/3
            f_l,f_r=f(l),f(r)
            if maximize:
                if f_l>=f_r>=f_R:
                    R=r
                    f_R=f_r
                elif f_L<=f_l<=f_r:
                    L=l
                    f_L=f_l
                else:
                    L,R=l,r
                    f_L,f_R=f_l,f_r
            else:
                if f_l<=f_r<=f_R:
                    R=r
                    f_R=f_r
                elif f_L>=f_l>=f_r:
                    L=l
                    f_L=f_l
                else:
                    L,R=l,r
                    f_L,f_R=f_l,f_r
    return L

N=int(readline())
A=[0]+list(map(int,readline().split()))
for i in range(1,N+1):
    A[i]+=A[i-1]
def f(x):
    return max(A[i]-i*x for i in range(N+1))-min(A[i]-i*x for i in range(N+1))
x=Tersect_Float(-1<<30,1<<30,f)
ans=f(x)
print(ans)