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 A[200010];
int N;
double mxsum(double x) {
  int i;
  double mx, cur;
  mx = cur = 0;
  for (i = 0; i < N; ++i) {
    cur = max(cur + A[i] - x, A[i] - x);
    mx = max(cur, mx);
  }
  return mx;
}
double mnsum(double x) {
  int i;
  double cur, mn;
  cur = mn = 0;
  for (i = 0; i < N; ++i) {
    cur = min(cur + A[i] - x, A[i] - x);
    mn = min(cur, mn);
  }
  return mn;
}
double search() {
  double low = -(1e4), high = 1e4;
  double mn, mx;
  double mid;
  while ((high - low) >= (1e-11)) {
    mid = low + (high - low) / 2;
    mn = mnsum(mid);
    mx = mxsum(mid);
    if (mx > -mn) {
      low = mid;
    } else {
      high = mid;
    }
  }
  return low;
}
int main() {
  double x;
  cin >> N;
  int i;
  for (i = 0; i < N; ++i) cin >> A[i];
  x = search();
  double mx, mn;
  mn = mnsum(x);
  mx = mxsum(x);
  printf("%.8lf", max(mx, -mn));
  return 0;
}
