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 MAX = 200001;
int n;
int v[MAX];
double first(double x) {
  double ret = 0;
  double s1 = 0, s2 = 0;
  for (int i = 0; i < n; i++) {
    s1 += v[i] - x;
    ret = max(ret, s1);
    s1 = max(s1, 0.0);
    s2 += v[i] - x;
    ret = max(ret, -s2);
    s2 = min(s2, 0.0);
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);
  double l = -1e9, r = 1e9;
  int nbr(150);
  while (r - l > 1e-12) {
    if (!nbr) break;
    nbr--;
    double m1 = (2.0 * l + r) / 3.0;
    double m2 = (l + 2.0 * r) / 3.0;
    if (first(m1) > first(m2))
      l = m1;
    else
      r = m2;
  }
  cout << fixed << setprecision(12) << first(l) << endl;
  return 0;
}
