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>
const long long mod = 1000000007ll;
using namespace std;
int ar[200007];
int n;
double maxe, mine, mxtmp, mntmp;
inline void f(double x) {
  mine = 10000;
  maxe = -10000;
  mxtmp = mntmp = 0;
  for (int i = 0; i < n; i++) {
    mxtmp += (ar[i] - x);
    if (mxtmp < 0) mxtmp = 0;
    if (mxtmp > maxe) maxe = mxtmp;
    mntmp += (ar[i] - x);
    if (mntmp > 0) mntmp = 0;
    if (mntmp < mine) mine = mntmp;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", ar + i);
  }
  double l = -10000, h = 10000, m;
  double minweak = 10000000000;
  int lim = 100;
  while (lim--) {
    m = (l + h) / 2;
    f(m);
    if (maxe + mine > 0)
      l = m;
    else
      h = m;
  }
  printf("%.9f\n", maxe);
  return 0;
}
