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;
using ll = long long;
const ll llinf = 0x3f3f3f3f3f3f3f3f;
const ll inf = 0x3f3f3f3f3f;
const double eps = 1e-9;
int n;
int t[200010];
double now, max_glo, min_glo;
double a, b, m1, m2, res;
double f(double x) {
  now = 0;
  max_glo = -llinf;
  for (int i = 0; i < n; i++) {
    if (0 > now) {
      now = t[i] - x;
    } else {
      now += t[i] - x;
    }
    if (max_glo < now) {
      max_glo = now;
    }
  }
  now = 0;
  min_glo = llinf;
  for (int i = 0; i < n; i++) {
    if (0 < now) {
      now = t[i] - x;
    } else {
      now += t[i] - x;
    }
    if (min_glo > now) {
      min_glo = now;
    }
  }
  return max(abs(max_glo), abs(min_glo));
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> t[i];
  int mx = -inf;
  int mn = inf;
  for (int i = 0; i < n; i++) {
    mx = max(mx, t[i]);
    mn = min(mn, t[i]);
  }
  a = mn;
  b = mx;
  int cnt = 0;
  while (cnt++ < 200) {
    m1 = a + (b - a) / 3;
    m2 = b - (b - a) / 3;
    if (f(m1) < f(m2)) {
      b = m2;
    } else {
      a = m1;
    }
  }
  cout << fixed << f(b) << '\n';
  return 0;
}
