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 f(x):
    mx, cur = 0, 0
    for i in range(n):
        cur = max(cur, 0) + a[i] - x
        mx = max(mx, cur)
    cur = 0
    for i in range(n):
        cur = max(cur, 0) + x - a[i]
        mx = max(mx, cur)
    return mx

L, R = min(a), max(a) + 1

for t in range(100):
    d = (R - L) / 3
    x1, x2 = L + d, R - d
    if f(x1) > f(x2):
        L = x1
    else:
        R = x2

print('{:.10f}'.format(f(L)))
