#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;
}
