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 N = 200010;
const double e = 1e-11;
double a[N];
int n;
double miin, maax;
double Min, Max;
void Do(double t) {
  Min = 1e9;
  Max = -1e9;
  double sum = 0;
  double in = 0, ax = 0;
  for (int i = 0; i < n; ++i) {
    sum += a[i] + t;
    in = min(in, sum);
    ax = max(ax, sum);
    Min = min(Min, sum - ax);
    Max = max(Max, sum - in);
  }
  if (!Min) Min = miin + t;
  if (!Max) Max = maax + t;
}
void binup() {
  double l = 0, r = 10000;
  while (r - l > e) {
    double m = (l + r) / 2;
    Do(m);
    if (-Min < Max)
      r = m;
    else
      l = m;
  }
  Do(l);
}
void bindown() {
  double l = -10000, r = 0;
  while (r - l > e) {
    double m = (l + r) / 2;
    Do(m);
    if (-Min > Max)
      l = m;
    else
      r = m;
  }
  Do(l);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  miin = 1e9;
  maax = -1e9;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    miin = min(miin, a[i]);
    maax = max(maax, a[i]);
  }
  Do(0);
  if (-Min < Max)
    bindown();
  else
    binup();
  printf("%0.12f", (Max - Min) / 2);
}
