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;
const int MAXN = 1e6 + 10;
const int INF = 2000000010;
const long long INFLL = 999999999999999999ll;
const double eps = 1e-11;
int origin[MAXN];
double cop[MAXN];
int n;
double f(double x) {
  for (int i = 1; i <= n; i++) cop[i] = 1.0 * origin[i] - x;
  double maxx = 0;
  double cur = 0;
  for (int i = 1; i <= n; i++) {
    cur = max(0.0, cur + cop[i]);
    maxx = max(maxx, cur);
  }
  double ret = maxx;
  maxx = 0;
  for (int i = 1; i <= n; i++) cop[i] *= -1;
  cur = 0;
  for (int i = 1; i <= n; i++) {
    cur = max(0.0, cur + cop[i]);
    maxx = max(maxx, cur);
  }
  return max(ret, maxx);
}
double ternary(double left, double right) {
  if (right - left < eps) return (left + right) / 2.0;
  double leftThird = (2.0 * left + right) / 3.0;
  double rightThird = (left + 2.0 * right) / 3.0;
  if (f(leftThird) > f(rightThird))
    return ternary(leftThird, right);
  else
    return ternary(left, rightThird);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &origin[i]);
  printf("%lf\n", f(ternary(-20000.0, 20000.0)));
  return 0;
}
