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 = (int)2e5 + 10;
const int INF = (int)0x7f7f7f7f;
int n, a[MAXN];
double b[MAXN], s[MAXN];
double MCS() {
  s[0] = 0;
  for (int i = 1; i <= n; ++i) s[i] = s[i - 1] + b[i];
  double m = 0;
  double ans = -INF;
  for (int i = 1; i <= n; ++i) {
    ans = max(ans, s[i] - m);
    m = min(m, s[i]);
  }
  return ans;
}
void Cal(double x, double &p, double &q) {
  for (int i = 1; i <= n; ++i) b[i] = a[i] - x;
  p = MCS();
  for (int i = 1; i <= n; ++i) b[i] = x - a[i];
  q = MCS();
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  double l = 0;
  double r = INF;
  double ans = INF;
  for (int k = 0; k <= 100; ++k) {
    double m = (l + r) / 2;
    double x, y;
    Cal(m, x, y);
    ans = min(ans, max(x, y));
    if (x > y)
      l = m;
    else
      r = m;
  }
  cout << fixed << setprecision(10) << ans;
  return 0;
}
