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 + 5;
int n;
double a[N];
double max_poor(double x) {
  int i;
  double pre, mpre, ret = 0;
  pre = mpre = 0;
  for (i = 0; i < n; i++) {
    pre += a[i] - x;
    ret = max(ret, abs(pre - mpre));
    mpre = min(mpre, pre);
  }
  pre = mpre = 0;
  for (i = 0; i < n; i++) {
    pre += a[i] - x;
    ret = max(ret, abs(pre - mpre));
    mpre = max(mpre, pre);
  }
  return ret;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int i;
  double l = 0.0, h = 0.0, m1, m2;
  cin >> n;
  for (i = 0; i < n; h = max(h, abs(a[i])), i++) cin >> a[i];
  l = -h;
  for (i = 0; i < 300; i++) {
    m1 = l + (h - l) / 3;
    m2 = h - (h - l) / 3;
    if (max_poor(m1) > max_poor(m2))
      l = m1;
    else
      h = m2;
  }
  printf("%.17f\n", max_poor(l));
  return 0;
}
