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).
import sys
n = int(sys.stdin.readline())
a = [int(x) for x in sys.stdin.readline().split()]

eps = 1e-12

def f(x):
    mx = a[0] - x
    ts = 0.0
    for i in range(0, n):
        ts = max(ts + a[i] - x, a[i] - x)
        mx = max(ts, mx)

    mn = a[0] - x
    ts = 0.0
    for i in range(0, n):
        ts = min(ts + a[i] - x, a[i] - x)
        mn = min(ts, mn)

    return abs(mx), abs(mn)

l = -10000
r = 10000
while abs(l - r) > eps:
    m = (l + r) / 2
    f1, f2 = f(m)
    if f1 > f2:
        l = m
    else:
        r = m

print(f(l))