#include <bits/stdc++.h>
using namespace std;
void Read(int& x, bool mark = 0) {
  char tt = getchar();
  for (; tt < '0' || '9' < tt; tt = getchar())
    if (tt == '-') mark = 1;
  for (x = 0; '0' <= tt && tt <= '9';
       x = (x << 1) + (x << 3) + tt - '0', tt = getchar())
    ;
  x = mark ? -x : x;
}
int n;
double a[200010];
double Left = 1e10;
double Right = -1e10;
void Init() {
  Read(n);
  for (int i = (1), c = (n); i <= c; ++i) {
    scanf("%lf", a + i);
    Left = min(Left, a[i]);
    Right = max(Right, a[i]);
  }
}
double Cal(double x) {
  double prefix = 0;
  double minSofar = 1e10;
  double maxSofar = -1e10;
  for (int i = (1), c = (n); i <= c; ++i) {
    prefix += a[i] - x;
    minSofar = min(minSofar, prefix);
    maxSofar = max(maxSofar, prefix);
  }
  if (minSofar * maxSofar > 0)
    return max(fabs(minSofar), fabs(maxSofar));
  else
    return maxSofar - minSofar;
}
void Solve() {
  double Mid, Mmid;
  for (int asd = (0), c = (100); asd <= c; ++asd) {
    Mid = (2 * Left + Right) / 3;
    Mmid = (Left + 2 * Right) / 3;
    if (Cal(Mid) < Cal(Mmid)) {
      Right = Mmid;
    } else
      Left = Mid;
  }
  printf("%.6lf\n", Cal(0.5 * (Left + Right)));
}
int main() {
  Init();
  Solve();
  return 0;
}
