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 get_max(b):
    ans = b[0];
    x = b[0];
    for i in range(1, len(b)):
        if(x >= 0):
            x = x + b[i];
        else:
            x = b[i];
        if( x >= ans ):
            ans = x;
    if( ans < 0 ):
        ans = - ans;
    return ans;

def run(x, a):
    b = [];
    for val in a:
        b.append(val - x);
    ans1 = get_max(b);
    for i in range(0, len(b)):
        b[i] = - b[i];
    ans2 = get_max(b);
    if ans1 <= ans2:
        return ans2;
    return ans1;

n = map(int, input());
a = list(map(int, input().split()));
eps = 1e-9;
ans = 20000000000;
lft = 0;
rht = 1000000000;
while (lft + eps < rht):
    mid1 = 0.5 * (lft + rht);
    mid2 = 0.5 * (mid1 + rht);
    ans1 = run(mid1, a);
    ans2 = run(mid2, a);
    if ans1 <= ans2:
        ans = ans1;
        rht = mid2 - eps;
    else:
        ans = ans2;
        lft = mid1 + eps;
print (ans);
