#include <bits/stdc++.h>
using namespace std;
const int N = 1234567;
const double eps = 1e-11;
const int inf = (int)2e9;
const int mod = (int)1e9 + 7;
double a[200009];
double b[200009];
int n;
double get() {
  double sum = 0;
  double ans = 0;
  for (int i = 0; i < n; ++i) {
    if (b[i] + sum < 0)
      sum = 0;
    else
      sum = sum + b[i];
    ans = max(ans, sum);
  }
  return ans;
}
double f(double k) {
  double ret = 0;
  for (int i = 0; i < n; ++i) b[i] = a[i] - k;
  ret = get();
  for (int i = 0; i < n; ++i) b[i] = -b[i];
  ret = max(ret, get());
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%lf", a + i);
  }
  int cnt = 400;
  double l = -1e10, r = 1e10;
  while (cnt--) {
    double m1 = l + (r - l) / 3, m2 = r - (r - l) / 3;
    if (f(m1) > f(m2))
      l = m1;
    else
      r = m2;
  }
  cout << fixed << setprecision(16) << f(r) << "\n";
  return 0;
}
