#include <bits/stdc++.h>
using namespace std;
int n, arr[200002];
void Input() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &arr[i]);
  }
}
long double eabs(long double num) {
  if (num < 0) return -num;
  return num;
}
long double Evaluate(long double x) {
  long double res = 0.0, curmin = 0.0, curmax = 0.0, cursum = 0.0;
  for (int i = 1; i <= n; i++) {
    long double val = (long double)arr[i] - x;
    cursum += val;
    curmin = min(curmin, cursum);
    curmax = max(curmax, cursum);
    res = max(res, eabs(cursum - curmin));
    res = max(res, eabs(cursum - curmax));
  }
  return res;
}
long double eps = 0.0000000000001;
bool Equal(long double a, long double b) { return (eabs(a - b) < eps); }
int main() {
  long double bl, br, bmid, bres = -1.0;
  bl = -10000.0;
  br = 10000.0;
  Input();
  while (bl < br || (Equal(bl, br))) {
    bmid = (bl + br) / 2.0;
    long double prev = Evaluate(bmid - eps), cur = Evaluate(bmid);
    if (bres < 0) bres = cur;
    bres = min(bres, cur);
    if (prev < cur) {
      br = bmid - eps;
    } else {
      bl = bmid + eps;
    }
  }
  printf("%.7f\n", (double)bres);
}
