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 dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1, -1, -1, 0, 1, -1, 0, 1};
int kx8[] = {1, 1, 2, 2, -1, -1, -2, -2};
int ky8[] = {2, -2, 1, -1, 2, -2, 1, -1};
long long bigmod(long long a, long long b, long long c) {
  if (b == 0) return 1 % c;
  long long x = bigmod(a, b / 2, c);
  x = x * x % c;
  if (b % 2 == 1) x = x * a % c;
  return x;
}
long long mod_inverse(long long a, long long mod) {
  return bigmod(a, mod - 2, mod);
}
double a[2 * 100005];
double b[2 * 100005];
double fun(int n) {
  double mx = -1e15;
  double sum = 0;
  int ptr = 0;
  for (int i = 0; i < (n); i++) {
    sum += b[i];
    while (sum < 0 && ptr < i) {
      sum -= b[ptr++];
    }
    mx = max(sum, mx);
  }
  return mx;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k;
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> a[i];
  long long lw = -100000, hi = 100000, ans = 0, mid, midd;
  double res = 1e15;
  for (int i = 0; i < (100); i++) {
    mid = (lw + hi) / 2;
    midd = mid + 1;
    for (int i = 0; i < (n); i++) {
      b[i] = a[i] - mid;
    }
    double d1 = fun(n);
    for (int i = 0; i < (n); i++) {
      b[i] *= -1.0;
    }
    double d2 = fun(n);
    double mx = max(d1, d2);
    for (int i = 0; i < (n); i++) {
      b[i] = a[i] - midd;
    }
    d1 = fun(n);
    for (int i = 0; i < (n); i++) {
      b[i] *= -1.0;
    }
    d2 = fun(n);
    double mxx = max(d1, d2);
    if (mx < mxx) {
      hi = mid;
      ans = mid;
      res = mx;
    } else {
      lw = midd;
      ans = midd;
      res = mxx;
    }
  }
  for (double mid = ans - 5; mid <= ans + 5; mid += 0.5) {
    for (int i = 0; i < (n); i++) {
      b[i] = a[i] - mid;
    }
    double d1 = fun(n);
    for (int i = 0; i < (n); i++) {
      b[i] *= -1;
    }
    double d2 = fun(n);
    double mx = max(d1, d2);
    res = min(res, mx);
  }
  cout << fixed << setprecision(10) << res << endl;
  return 0;
}
