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;
int n;
int a[200002];
double b[200002];
template <class T>
void read(T &x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') f |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
  x = f ? -x : x;
  return;
}
inline double Min(double a, double b) { return a < b ? 1 : 0; }
inline double Max(double a, double b) { return a > b ? 1 : 0; }
inline double calc(double x) {
  double ans = 0, mn = 0, mx = 0;
  for (int i = 1; i <= n; ++i) b[i] = a[i] - x;
  for (int i = 2; i <= n; ++i) b[i] += b[i - 1];
  for (int i = 1; i <= n; ++i) mn = min(mn, b[i]), mx = max(mx, b[i]);
  return mx - mn;
}
inline double Trichotomy() {
  double l = -100000, r = 100000, l1, r1, fl1, fr1;
  while (r - l > 1e-10) {
    l1 = (2 * l + r) / 3, r1 = (l + 2 * r) / 3, fl1 = calc(l1), fr1 = calc(r1);
    if (fl1 > fr1)
      l = l1;
    else
      r = r1;
  }
  return fl1;
}
int main() {
  read(n);
  for (int i = 1; i <= n; ++i) read(a[i]);
  printf("%.8lf", Trichotomy());
  return 0;
}
