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 N = 2e5 + 100;
const int inf = 1e9;
int n, a[N];
double ma(double p) {
  double sum = a[1] - p, b = a[1] - p;
  for (int i = 2; i <= n; i++) {
    if (b > 0)
      b += a[i] - p;
    else
      b = a[i] - p;
    sum = max(sum, b);
  }
  return abs(sum);
}
double mi(double p) {
  double sum = a[1] - p, b = a[1] - p;
  for (int i = 2; i <= n; i++) {
    if (b < 0)
      b += a[i] - p;
    else
      b = a[i] - p;
    sum = min(sum, b);
  }
  return abs(sum);
}
double work(double p) { return max(ma(p), mi(p)); }
double cal() {
  double l = -10000, r = -l;
  double X;
  int cnt = 300;
  while (cnt--) {
    double mid1 = (2 * l + r) / 3.0, mid2 = (2 * r + l) / 3;
    double x = work(mid1), y = work(mid2);
    X = min(x, y);
    if (x <= y) {
      r = mid2;
    } else {
      l = mid1;
    }
  }
  return X;
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    printf("%.12f\n", cal());
  }
  return 0;
}
