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 ar[200050];
double v[200050], ma[200050], mi[200050];
double fun(double x, int n) {
  int i;
  for (i = 0; i < n; i++) v[i] = ar[i] - x;
  for (i = 1; i < n; i++) v[i] += v[i - 1];
  double a = INT_MIN, b = INT_MAX;
  for (i = 0; i < n; i++) a = max(a, v[i]), b = min(b, v[i]);
  ma[0] = v[0], mi[0] = v[0];
  for (i = 0; i < n; i++)
    ma[i] = max(ma[i - 1], v[i]), mi[i] = min(mi[i - 1], v[i]);
  double c = INT_MIN, d = INT_MAX;
  for (i = n - 1; i >= 0; i--) {
    c = max(c, v[i]);
    a = max(a, c - mi[i]);
    d = min(d, v[i]);
    b = min(b, d - ma[i]);
  }
  a = max(abs(a), abs(b));
  return a;
}
double cal(int n) {
  int i;
  int p = 100000, q = -100000;
  for (i = 0; i < n; i++) p = min(p, ar[i]), q = max(q, ar[i]);
  double l = p, h = q;
  double x, y;
  for (i = 0; i < 71; i++) {
    x = 2 * l + h, y = l + 2 * h;
    x /= 3, y /= 3;
    if (fun(x, n) > fun(y, n))
      l = x;
    else
      h = y;
  }
  return fun(l, n);
}
int main() {
  int i, n;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &ar[i]);
  cout << setprecision(12) << fixed;
  cout << cal(n) << endl;
}
