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).
n = int(input())
A = list(map(int,input().split()))

def weak(A,x):
    big = small = 0
    ans = cur = 0
    for y in A:
        cur += y-x
        ans = max(ans, abs(big - cur), abs(small - cur))

        big = max(big, cur)
        small = min(small, cur)

    return ans

def f(lo, hi):
    N = 100
    err = 5
    gap = (hi - lo)/N
    X = [lo + k*gap for k in range(N)]
    W = [weak(A,x) for x in X]
    idx = W.index(min(W))
    return X[max(0, idx-err)], X[min(N-1, idx+err)]

lo,hi = -10000,10000
threshold = 1e-7
while hi-lo > threshold:
    lo,hi = f(lo,hi)

print(weak(A,lo))

