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;
double a[200010], s[200010] = {};
double f(double x) {
  double mi = 0, mx = 0, ret = 0;
  for (int i = 1; i <= n; ++i) {
    s[i] = s[i - 1] + a[i] - x;
    ret = max(ret, fabs(s[i] - mi));
    ret = max(ret, fabs(s[i] - mx));
    mi = min(mi, s[i]);
    mx = max(mx, s[i]);
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x; i <= n; ++i) {
    scanf("%d", &x);
    a[i] = x;
  }
  double l = -1000000, r = 1000000;
  for (int i = 0; i < 100; ++i) {
    double m1 = l + (r - l) * 0.33;
    double m2 = l + (r - l) * 0.67;
    double r1 = f(m1);
    double r2 = f(m2);
    if (r1 > r2)
      l = m1;
    else
      r = m2;
  }
  printf("%.12f\n", f((l + r) / 2));
  return 0;
}
