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 + 10;
int n;
int a[N];
double maxSuff[N];
double minSuff[N];
double mx[N], mn[N];
double f(double x) {
  double tmp;
  for (int i = 1; i <= n; i++) {
    tmp = a[i] - x;
    mx[i] = mn[i] = maxSuff[i] = minSuff[i] = 0;
    maxSuff[i] = max(0.0, maxSuff[i - 1] + tmp);
    minSuff[i] = min(0.0, minSuff[i - 1] + tmp);
    mx[i] = max(mx[i - 1], maxSuff[i - 1] + tmp);
    mn[i] = min(mn[i - 1], minSuff[i - 1] + tmp);
  }
  return max(abs(mx[n]), abs(mn[n]));
}
double tsearch(double l, double r) {
  double a, b;
  for (int i = 0; i < 500; i++) {
    a = l + (r - l) / 3;
    b = r - (r - l) / 3;
    if (f(a) < f(b)) {
      r = b;
    } else {
      l = a;
    }
  }
  return (r + l) / 2;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  printf("%.8lf\n", f(tsearch(-2e9 - 9, 2e9 + 7)));
  return 0;
}
