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 IntMaxVal = (int)1e20;
int IntMinVal = (int)-1e20;
long long LongMaxVal = (long long)1e20;
long long LongMinVal = (long long)-1e20;
template <typename T>
inline void minimize(T& a, T b) {
  a = std::min(a, b);
}
template <typename T>
inline void maximize(T& a, T b) {
  a = std::max(a, b);
}
template <typename T>
inline void swap(pair<T, T>& p) {
  swap(p.first, p.second);
}
template <typename T>
struct argument_type;
template <typename T, typename U>
struct argument_type<T(U)> {};
template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& s) {
  is >> s.first >> s.second;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (int i = 0; i < v.size(); i++) {
    if (i) os << ' ';
    os << v[i];
  }
  os << '\n';
  return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const vector<pair<T1, T2>>& v) {
  for (int i = 0; i < v.size(); i++) {
    os << v[i] << '\n';
  }
  return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& s, const pair<T1, T2>& t) {
  s << t.first << ' ' << t.second;
  return s;
}
template <typename T>
vector<T> readVector(int n) {
  vector<T> res(n);
  for (int i = 0; i < n; i++) cin >> res[i];
  return res;
}
double get_max_sum(vector<double>& v, int l, int r) {
  if (l == r) return max(0.0, v[l]);
  if (l + 10 < r) {
    double ans = 0;
    for (int l2 = l; l2 < r + 1; ++l2) {
      double cur = 0;
      for (int r2 = l2; r2 < r + 1; ++r2) {
        cur += v[r2];
        maximize(ans, cur);
      }
    }
    return ans;
  }
  double ans = 0;
  int mid = (l + r) / 2;
  maximize(ans, get_max_sum(v, l, mid));
  maximize(ans, get_max_sum(v, mid + 1, r));
  double max_prefix = 0;
  double cur_prefix = 0;
  for (int i = mid; i >= l; --i) {
    cur_prefix += v[i];
    maximize(max_prefix, cur_prefix);
  }
  double max_suffix = 0;
  double cur_suffix = 0;
  for (int i = mid + 1; i < r + 1; ++i) {
    cur_suffix += v[i];
    maximize(max_suffix, cur_suffix);
  }
  maximize(ans, max_prefix + max_suffix);
  return ans;
}
double check(vector<int>& v2, double x, double& a) {
  int n = v2.size();
  static vector<double> v;
  if (v.empty()) v.resize(n);
  for (int i = 0; i < n; ++i) v[i] = v2[i] - x;
  double a1 = fabs(get_max_sum(v, 0, n - 1));
  for (int i = 0; i < n; ++i) v[i] = -v[i];
  double a2 = fabs(get_max_sum(v, 0, n - 1));
  cout << x << ' ' << a1 << ' ' << a2 << '\n';
  a = max(a1, a2);
  return a1 > a2;
}
double get_a(vector<int>& v2, double x) {
  int n = v2.size();
  static vector<double> v;
  if (v.empty()) v.resize(n);
  for (int i = 0; i < n; ++i) v[i] = v2[i] - x;
  double ans = 0;
  maximize(ans, fabs(get_max_sum(v, 0, n - 1)));
  for (int i = 0; i < n; ++i) v[i] = -v[i];
  maximize(ans, fabs(get_max_sum(v, 0, n - 1)));
  return ans;
}
int main() {
  srand(time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  fixed(cout);
  cout << setprecision(10);
  argument_type<void(int)>::U n;
  cin >> n;
  ;
  auto v = readVector<int>(n);
  double xl = -1e9;
  double xr = 1e9;
  double al = get_a(v, xl);
  double ar = get_a(v, xr);
  int it = 0;
  while (fabs(al - ar) > 1e-7) {
    it++;
    double mid = (xr + xl) / 2;
    double a;
    if (check(v, mid, a)) {
      xl = mid;
      al = a;
    } else {
      xr = mid;
      ar = a;
    }
  }
  cout << (al + ar) / 2;
  cerr << it;
}
