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;
const long long int N = 1e6;
const long long int inf = 1e14;
const long long int mod = 1e9 + 7;
const double PI = acos(-1);
long long int powm(long long int a, long long int b) {
  a = a % mod;
  long long int res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long int n, a[N];
long double f(long double xn) {
  set<long double> b = {0};
  long double su = 0, ans = 0;
  long double ma = 0, mi = 0;
  for (int i = 0; i < n; i++) {
    su += (long double)a[i] - xn;
    ans = max({ans, abs(su - mi), abs(su - ma)});
    ma = max(ma, su);
    mi = min(mi, su);
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  cout << fixed << std::setprecision(10);
  while (t--) {
    cin >> n;
    long double B = -100000;
    long double A = 100000;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      B = max(B, (long double)a[i]);
      A = min(A, (long double)a[i]);
    }
    for (int i = 0; i < 100; i++) {
      long double m1 = (A * 2 + B) / 3.0;
      long double m2 = (A + 2 * B) / 3.0;
      if (f(m1) > f(m2))
        A = m1;
      else
        B = m2;
    }
    cout << f(A) << '\n';
  }
}
