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):
    B = [0]
    C = [0]
    for i in range(n):
        B.append(A[i] - x + B[-1])
        C.append(x - A[i] + C[-1])
    cnt1 = -10 ** 10
    minsum1 = 10 ** 10
    for i in range(len(B)):
        if B[i] - minsum1 > cnt1:
            cnt1 = B[i] - minsum1
        if B[i] <= minsum1:
            minsum1 = B[i]
    cnt2 = -10 ** 10
    minsum2 = 10 ** 10
    for i in range(len(B)):
        if C[i] - minsum2 > cnt2:
            cnt2 = C[i] - minsum2
        if C[i] <= minsum2:
            minsum2 = C[i]
    return max(cnt1, cnt2)


n = int(input())
A = list(map(int, input().split()))
l = min(A)
r = max(A)
for _ in range(1000):
    p = l + (r - l) / 3
    q = r - (r - l) / 3
    x = f(p)
    y = f(q)
    if x > y:
        l = p
    elif y > x:
        r = q
    else:
        l = p
        r = q
print(f(l))