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;
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;
  while (fabs(Left - Right) > 1e-11) {
    Mid = (Left + Right) / 2;
    Mmid = (Mid + Right) / 2;
    double a = Cal(Mid);
    double b = Cal(Mmid);
    if (a < b) {
      Right = Mmid;
    } else
      Left = Mid;
  }
  printf("%.15lf\n", Cal(Left));
}
int main() {
  Init();
  Solve();
  return 0;
}
