10
-405 -230 252 -393 -390 -259 97 163 81 -129
 3
10000 -10000 10000
 1
-10000
 20
-16 -23 29 44 -40 -50 -41 34 -38 30 -12 28 -44 -49 15 50 -28 38 -2 0

702.333333333333712
 10000.000000000016371
 0.000000000000000
 113.875000000000043

#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 1;
const long double EPS = 1e-9;
int n;
int a[N];
long double b[N];
long double f(long double x) {
  long double sum_1 = (b[0] - x), csum_1 = 0;
  long double sum_2 = (-b[0] + x), csum_2 = 0;
  for (int i = 0; i < n; i++) {
    csum_1 += (b[i] - x), csum_2 += (-b[i] + x);
    if (csum_1 > sum_1) sum_1 = csum_1;
    if (csum_2 > sum_2) sum_2 = csum_2;
    if (csum_1 < 0) csum_1 = 0;
    if (csum_2 < 0) csum_2 = 0;
  }
  if (sum_1 < 0) sum_1 = -sum_1;
  if (sum_2 < 0) sum_2 = -sum_2;
  return max(sum_1, sum_2);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    b[i] = a[i];
  }
  long double l = -2e4, r = 2e4;
  while (r - l > EPS) {
    long double m = (l + r) / 2;
    if (f(m) > f(m + EPS))
      l = m;
    else
      r = m;
  }
  cout << fixed << setprecision(9) << f((l + r) / 2);
  return 0;
}
