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