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 weakness(a, x):
    a = [elem-x for elem in a]
    acumulado = maximo = 0
    for elem in a:
        if acumulado + elem > 0:
            acumulado += elem
        else:
            acumulado = 0
        if acumulado > maximo:
            maximo = acumulado
    acumulado = minimo = 0
    for elem in a:
        if acumulado + elem < 0:
            acumulado += elem
        else:
            acumulado = 0
        if acumulado < minimo:
            minimo = acumulado
    return max(maximo, -minimo)


n, a = input(), list(map(int, input().split()))

inf, sup = min(a), max(a)
for _ in range(70):
    c1, c2 = (2*inf+sup)/3, (inf+2*sup)/3
    if weakness(a, c1) < weakness(a, c2):
        sup = c2
    else:
        inf = c1

print(weakness(a, (inf+sup)/2))

 	  	  	 		 	 		     			 						