#include <bits/stdc++.h>
using namespace std;
bool compare(int a, int b) { return a > b; }
class Compare {
 public:
  bool operator()(int a, int b) { return a > b; }
};
int mod(int a, int b) { return ((a % b) + b) % b; }
int n, a[200009];
double f(double x) {
  double g_mx = -100000000000, l_mx = 0, l_mn = 0;
  for (int i = 0; i < n; i++) {
    double q = a[i] - x, p1 = l_mx + q, p2 = l_mn + q;
    l_mx = max(q, p1), l_mn = min(q, p2);
    g_mx = max(g_mx, max(fabs(l_mn), fabs(l_mx)));
  }
  return g_mx;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  double l = -100000.0, r = 100000.0, m1, m2;
  for (int i = 0; i < 250; i++) {
    m1 = l + (r - l) / 3.0;
    m2 = r - (r - l) / 3.0;
    if (f(m1) > f(m2))
      l = m1;
    else
      r = m2;
  }
  printf("%.12lf\n", f(m1));
  return 0;
}
