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;
using i64 = long long;
using Pii = pair<int, int>;
constexpr int MAX = 200010;
constexpr double INF = 1e20;
constexpr double eps = 1e-10;
int a[MAX];
double sum[MAX];
double Calc(int n, double d) {
  double ret = 0;
  sum[0] = 0;
  for (int i = 1; i <= n; ++i) {
    sum[i] = (double)a[i] - d;
    sum[i] += sum[i - 1];
  }
  double l = 0, r = 0;
  for (int i = 1; i <= n; ++i) {
    ret = max(ret, fabs(sum[i] - l));
    ret = max(ret, fabs(sum[i] - r));
    l = min(l, sum[i]);
    r = max(r, sum[i]);
  }
  return ret;
}
double Solve(int n) {
  double l = (double)*min_element(a, a + n);
  double r = (double)*max_element(a, a + n);
  double ret = 0;
  while (1) {
    double u = (l + r) / 2.0, v = (u + r) / 2.0;
    double x = Calc(n, u), y = Calc(n, v);
    if (fabs(x - y) < eps) {
      ret = (x + y) / 2.0;
      break;
    }
    if (x < y)
      r = v;
    else
      l = u;
  }
  return ret;
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; ++i) {
      scanf("%d", &a[i]);
    }
    printf("%.8f\n", Solve(n));
  }
  return 0;
}
