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;
double a[200011];
int n;
double check(double x) {
  for (int i = 1; i <= n; i++) {
    a[i] -= x;
  }
  double mi = min(0.0, a[1]);
  double ans = 0;
  double ma = max(0.0, a[1]);
  double cur = 0;
  for (int i = 1; i <= n; i++) {
    cur += a[i];
    mi = min(mi, cur);
    ma = max(ma, cur);
    ans = max(ans, cur);
    ans = max(ans, fabs(cur - mi));
    ans = max(ans, fabs(cur - ma));
  }
  for (int i = 1; i <= n; i++) {
    a[i] += x;
  }
  return ans;
}
int main() {
  double lo = 0;
  double hi = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    hi = max(hi, abs(a[i]));
  }
  lo = -hi;
  double mid;
  double m1, m2, v1, v2;
  for (int g = 0; g <= 200; g++) {
    m1 = lo + (hi - lo) / 3;
    m2 = lo + 2 * (hi - lo) / 3;
    v1 = check(m1);
    v2 = check(m2);
    if (v1 > v2) {
      lo = m1;
    } else if (v1 < v2) {
      hi = m2;
    } else {
      lo = m1;
      hi = m2;
    }
  }
  printf("%.10f", check(lo));
}
