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[200005];
double fmin(double x, int n) {
  double ans = 0, cur = 0;
  for (int i = 0; i < n; i++) {
    cur += (a[i] - x);
    if (cur > 0) cur = 0;
    ans = min(ans, cur);
  }
  return ((ans) > 0 ? (ans) : (-(ans)));
}
double fmax(double x, int n) {
  double ans = 0, cur = 0;
  for (int i = 0; i < n; i++) {
    cur += (a[i] - x);
    if (cur < 0) cur = 0;
    ans = max(ans, cur);
  }
  return ((ans) > 0 ? (ans) : (-(ans)));
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  double lo = -10000, hi = 10000, mid, v1 = -200, v2 = 200;
  while (((v1 - v2) > 0 ? (v1 - v2) : (-(v1 - v2))) > .4 * 1e-6) {
    mid = (lo + hi) / 2;
    v1 = fmin(mid, n);
    v2 = fmax(mid, n);
    if (v1 < v2)
      lo = mid;
    else
      hi = mid;
  }
  printf("%.9lf\n", v1);
  return 0;
}
