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 double EPS = 0.00000001;
const int MAXN = 2e5 + 5, INF = 1e9;
double tab[MAXN], n;
double dodaj(double x) {
  for (int i = 0; i < n; i++) {
    tab[i] += x;
  }
}
void znak() {
  for (int i = 0; i < n; i++) {
    tab[i] = -tab[i];
  }
}
double sum[MAXN];
double maksi() {
  sum[0] = tab[0];
  double maks = tab[0];
  for (int i = 1; i < n; i++) {
    sum[i] = max(sum[i - 1] + tab[i], tab[i]);
    maks = max(maks, sum[i]);
  }
  return maks;
}
double f(double x) {
  dodaj(-x);
  double maks1 = maksi();
  znak();
  double maks2 = maksi();
  znak();
  dodaj(x);
  return max(maks1, maks2);
}
double Ternary_Search(double l, double r) {
  while (r - l > EPS) {
    double midl = l + (r - l) / 3.;
    double midr = r - (r - l) / 3.;
    double f1 = f(midl), f2 = f(midr);
    if (f1 > f2)
      l = midl;
    else
      r = midr;
  }
  return (l + r) / 2;
}
int main() {
  cout << setprecision(7) << fixed;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tab[i];
  }
  double x = Ternary_Search(-INF, INF);
  cout << f(x) << "\n";
}
