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

def solve(n, As):
    if n == 1:
        return 0
    if n == 2:
        return abs(As[0] - As[1]) / 2
    left = min(As)
    right = max(As)
    eps = 0.5 * 10 ** -6
    r = (1 + 5 ** 0.5) ** 0.5
    r1 = 1 + r
    leftval = f((left * r + right)/r1, As)
    rightval = f((left + right * r)/r1, As)
    maxloop = 50
    for i in range(maxloop):
        if leftval > rightval:
            right = (left + right * r)/r1
            rightval = leftval
            leftval = f((left * r + right)/r1, As)
        else:
            left = (left * r + right)/r1
            leftval = rightval
            rightval = f((left + right * r)/r1, As)
    return min(leftval, rightval)
    
def f(x, As):
    cum = 0
    cmax = - float('inf')
    cmin = float('inf')
    for a in As:
        cum += a - x
        if cum > cmax:
            cmax = cum
        if cum < cmin:
            cmin = cum
    return cmax - cmin

print(solve(n, As))
