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 f(x):
  sm1 = 0
  sm2 = 0
  bst = 0
  for i in range(n):
    sm1 += a[i] - x
    if (sm1 < 0):
      sm1 = 0
			
    sm2 += a[i] - x
    if (sm2 > 0):
      sm2 = 0
			
    bst = max(max(sm1, abs(sm2)), bst)
  return bst

n = int(input())
a = list(map(int, input().split()))
l = -10000
r = 10000
for i in range(200): # 200 итераций
  m1 = (2 * l + r) / 3
  m2 = (2 * r + l) / 3
  if f(m1) > f(m2):
    l = m1
  else:
    r = m2
print(f((l + r)/ 2))
# Wed Mar 23 2022 16:28:36 GMT+0000 (Coordinated Universal Time)
