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;
long long s[200005];
double eval(double x) {
  double mx = -1e20, mn = 1e20;
  for (int i = (0); i < (n + 1); i++)
    mx = max(mx, s[i] - i * x), mn = min(mn, s[i] - i * x);
  return mx - mn;
}
int main() {
  scanf("%d", &n);
  for (int i = (0); i < (n); i++) {
    scanf("%lld", &s[i + 1]);
    s[i + 1] += s[i];
  }
  double st = 0, e = 100000;
  for (int Z = (0); Z < (128); Z++) {
    double md1 = (st * 2 + e) / 3, md2 = (st + 2 * e) / 3;
    double v1 = eval(md1), v2 = eval(md2);
    if (v1 > v2) {
      st = md1;
    } else {
      e = md2;
    }
  }
  printf("%.12lf\n", eval(st));
}
