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 double PI = 3.1415926535898;
const int mod = 1e9 + 7;
bool cmp(const int &a, const int &b);
double a[200005] = {0}, b[200005] = {0}, sum = 0;
int n;
double getmax() {
  double MAX = 0, x = 0;
  for (int i = 0; i < n; i++) {
    if (b[i] >= 0)
      x += b[i];
    else
      x = 0;
    MAX = max(MAX, x);
  }
  return MAX;
}
double fun(double x) {
  for (int i = 0; i < n; i++) b[i] = a[i] - x;
  double re = getmax();
  for (int i = 0; i < n; i++) b[i] = -b[i];
  re = max(re, getmax());
  return re;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lf", a + i);
    sum += a[i];
  }
  double l = -1000000000, r = 1000000000;
  int p = 600;
  while (p--) {
    double m1 = l + (r - l) / 3;
    double m2 = r - (r - l) / 3;
    if (fun(m1) < fun(m2))
      r = m2;
    else
      l = m1;
  }
  printf("%f\n", fun(l));
}
bool cmp(const int &a, const int &b) { return a > b; }
