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).
# UCSD ICPC SP22 Meeting 3
import sys
from itertools import chain
input = sys.stdin.readline
ii = lambda : int(input())
iil = lambda: [int(x) for x in input().split()]

n, = iil()
a = iil()

mini = min(a)
maxi = max(a)

def poorness(a,x):
    neg = [0]
    pos = [0]
    for i in a:
        it = i - x
        neg.append(min(neg[-1] + it, it))
        pos.append(max(pos[-1] + it, it))
    mini = max(-x for x in neg)
    maxi = max(y for y in pos)
    if maxi > mini:
        return maxi
    else:
        return -mini

# binary search, precision 10 ** -6
EPS = 10 ** -6
p = 0
mid = 0
last_p = float("inf")
while abs(p - last_p) > EPS:
    last_p = p
    mid = (maxi + mini) / 2 
    p = poorness(a, mid)
    print(mid, p)
    if p > 0:
        mini = mid 
    if p < 0:
        maxi = mid
    if p == 0:
        print(abs(p))
        exit()
    p = abs(p)
print(p)
			  	   	   		 	 	 	    	 			