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;
inline double MAX(double a, double b) { return (a < b) ? b : a; }
inline double MIN(double a, double b) { return (a > b) ? b : a; }
inline double ABS(double a) { return (a > 0) ? a : -a; }
int n;
int a[200100];
double compute(double x) {
  double summax = 0, summin = 0;
  double summaxaux = 0, summinaux = 0;
  for (int i = 0; i < n; ++i) {
    double p = a[i];
    p -= x;
    summaxaux = MAX(summaxaux + p, p);
    summax = MAX(summax, summaxaux);
    summinaux = MIN(summinaux + p, p);
    summin = MIN(summin, summinaux);
  }
  return MAX(ABS(summin), ABS(summax));
}
double ternary_search() {
  double right = 20011.0;
  double left = -20002.0;
  double sr = compute(right);
  double sl = compute(left);
  while (ABS(sr - sl) > 1e-7) {
    double p1 = left + (right - left) / 3.0;
    double p2 = right - (right - left) / 3.0;
    double x1 = compute(p1);
    double x2 = compute(p2);
    if (x2 < x1) {
      sl = x1;
      left = p1;
    } else {
      sr = x2;
      right = p2;
    }
  }
  return (sl + sr) / 2.0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  printf("%.9f", ternary_search());
  return 0;
}
