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>
double f_abs(double x) { return x < 0 ? -x : x; }
double f_max(double a, double b) { return a > b ? a : b; }
double f_min(double a, double b) { return a < b ? a : b; }
const double eps = 1e-12;
const int N = 200003;
int n;
double a[N], b[N];
void GetData() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%lf", &a[i]);
}
double Calc(double x) {
  int i;
  double dp, cur, res;
  for (i = 0; i < n; ++i) b[i] = a[i] - x;
  dp = cur = b[0];
  for (i = 1; i < n; ++i) {
    if (cur + b[i] < b[i])
      cur = b[i];
    else
      cur += b[i];
    dp = f_max(dp, cur);
  }
  res = f_abs(dp);
  dp = cur = b[0];
  for (i = 1; i < n; ++i) {
    if (cur + b[i] > b[i])
      cur = b[i];
    else
      cur += b[i];
    dp = f_min(dp, cur);
  }
  res = f_max(res, f_abs(dp));
  return res;
}
void Solve() {
  int cnt = 100;
  double lo, hi, midl, midr;
  lo = -1e4;
  hi = 1e4;
  while (fabs(hi - lo) > eps && cnt--) {
    midl = (hi + lo * 2) / 3;
    midr = (hi * 2 + lo) / 3;
    if (Calc(midl) > Calc(midr))
      lo = midl;
    else
      hi = midr;
  }
  printf("%.10lf\n", Calc(lo));
}
int main() {
  GetData();
  Solve();
  return 0;
}
