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 int MAXN = 5e5 + 256;
const char nxt = '\n';
const double eps = 1e-12;
inline bool Pal(const string& s) {
  return equal(s.begin(), s.end(), s.rbegin());
}
inline int readint() {
  bool neg = false;
  int ret = 0;
  char ch;
  ch = getchar();
  while (true) {
    if (ch == '-') {
      neg = true;
      break;
    }
    if (ch >= '0' && ch <= '9') break;
    ch = getchar();
  }
  if (!neg) ret = ch - '0';
  while (true) {
    ch = getchar();
    if (ch < '0' || ch > '9') break;
    ret = ret * 10 + ch - '0';
  }
  return neg ? -ret : ret;
}
int n;
long long arr[MAXN];
double ans, res = 1000000000.0000;
bool check(double x) {
  double sum1 = 0, sum2 = 0, curs1 = 0, curs2 = 0;
  for (int i = 1; i <= n; ++i) {
    double cur = (double)(arr[i] * 1.000);
    cur -= x;
    if (cur > 0) {
      curs2 = 0;
      curs1 += cur;
      sum1 = max(sum1, curs1);
      ans = max(curs1, ans);
    } else {
      curs2 -= cur;
      sum2 = max(sum2, curs2);
      curs1 = 0;
      ans = max(curs2, ans);
    }
  }
  ans = max(sum1, sum2);
  return (sum1 >= sum2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
  }
  double l = -100000000.0000, r = 100000000.00000;
  for (int i = 1; i <= 1000; ++i) {
    double mid = (l + r) / 2.000;
    if (check(mid)) {
      l = mid;
    } else
      r = mid;
  }
  ans = 0;
  check(l);
  cout << setprecision(10) << fixed << ans;
  return 0;
}
