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 double eps = 1e-9;
const long double pi = acos(-1.0);
const long long inf = 1e+9;
#pragma comment(linker, "/STACK:36777216")
template <typename T>
istream &operator>>(istream &, vector<T> &);
template <typename T>
ostream &operator<<(ostream &, const vector<T> &);
vector<long double> a;
int n;
long double calc(long double m) {
  long double maxV = -(inf)*inf;
  long double cur = 0;
  for (int i = 0; i < n; i++) {
    cur += a[i] + m;
    maxV = max(maxV, cur);
    cur = max(cur, long double(0));
  }
  maxV = max(maxV, (*max_element(a.begin(), a.end())) + m);
  long double minV = (inf)*inf;
  cur = 0;
  for (int i = 0; i < n; i++) {
    cur += a[i] + m;
    minV = min(minV, cur);
    cur = min(cur, long double(0));
  }
  minV = min(minV, (*min_element(a.begin(), a.end())) + m);
  return max(abs(maxV), abs(minV));
}
void solve() {
  cin >> n;
  a.resize(n);
  cin >> a;
  long double l = -long double(inf) * inf, r = long double(inf) * inf;
  while (r - l > eps) {
    long double m1 = l + (r - l) / 3;
    long double m2 = r - (r - l) / 3;
    long double v1 = calc(m1);
    long double v2 = calc(m2);
    if (v1 < v2)
      r = m2;
    else
      l = m1;
  }
  cout.setf(ios::fixed);
  cout.precision(9);
  cout << calc(l) << endl;
}
int main() {
  solve();
  return 0;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (int i = 0; i < v.size(); ++i) is >> v[i];
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (int i = 0; i < v.size(); ++i) os << v[i];
  return os;
}
