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;
int A[400001];
double P[400001];
double f(double x) {
  P[0] = 0;
  double max_seg = 0, min_seg = 0, max_p = 0, min_p = 0;
  for (int i = 1; i <= n; i++) {
    P[i] = P[i - 1] + A[i] - x;
    max_p = max(max_p, P[i]);
    min_p = min(min_p, P[i]);
    max_seg = max(max_seg, P[i] - min_p);
    min_seg = min(min_seg, P[i] - max_p);
  }
  return max(max_seg, -min_seg);
}
double ternary_search(double l, double r, double eps) {
  double m1, m2, val1, val2;
  while (r - l >= eps) {
    m1 = l + (r - l) / 3;
    m2 = r - (r - l) / 3;
    val1 = f(m1);
    val2 = f(m2);
    if (val1 == val2) {
      l = m1;
      r = m2;
    } else if (val1 < val2) {
      r = m2;
    } else {
      l = m1;
    }
  }
  return l;
}
double ternary_search_max(double l, double r, double eps) {
  double m1, m2, val1, val2;
  while (r - l >= eps) {
    m1 = l + (r - l) / 3;
    m2 = r - (r - l) / 3;
    val1 = f(m1);
    val2 = f(m2);
    if (val1 == val2) {
      l = m1;
      r = m2;
    } else if (val1 < val2) {
      l = m1;
    } else {
      r = m2;
    }
  }
  return l;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  A[0] = 0;
  int maxi = 0;
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
    if (A[i] > maxi) maxi = A[i];
  }
  cout.precision(13);
  cout << fixed << f(ternary_search(-10000, 10000, 1e-13)) << endl;
  return 0;
}
