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 long long inf = (1ll << 50);
const int mod = inf + 7;
const double pi = acos(-1.0);
const double eps = 1e-10;
double mi[220000], ma[220000], u[220000];
double second[220000];
int n, a[220000];
double first(double x) {
  for (int i = 1; i <= n; i++) second[i] = second[i - 1] + a[i] - x;
  mi[n] = second[n];
  ma[n] = second[n];
  for (int i = n - 1; i >= 1; i--) {
    ma[i] = max(ma[i + 1], second[i]);
    mi[i] = min(mi[i + 1], second[i]);
  }
  double res = 0, su = 0;
  for (int i = 1; i <= n; i++) {
    res = max(ma[i] + su, res);
    res = max(-(mi[i] + su), res);
    su += -a[i] + x;
  }
  return res;
}
int main() {
  scanf("%d", &n);
  long long e = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    e += a[i];
  }
  double l = -(1e14);
  double r = (1e14);
  for (int i = 0; i <= 300; i++) {
    double m1 = l + (r - l) / 3.0;
    double m2 = r - (r - l) / 3.0;
    if (first(m1) < first(m2))
      r = m2;
    else
      l = m1;
  }
  printf("%.10lf", first(l));
  return 0;
}
