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;
int i, n, a[200005];
double st = -1e4, dr = 1e4;
double ABS(double a) { return a > 0 ? a : -a; }
double Check1(double x) {
  double aux = 0, now = 0;
  for (int i = 1; i <= n; ++i) {
    now += a[i] - x;
    aux = max(aux, now);
    if (now < 0) now = 0;
  }
  return aux;
}
double Check2(double x) {
  double aux = 0, now = 0;
  for (int i = 1; i <= n; ++i) {
    now += x - a[i];
    aux = max(aux, now);
    if (now < 0) now = 0;
  }
  return aux;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (i = 1; i <= n; ++i) cin >> a[i];
  while (st <= dr) {
    double pivot = (st + dr) / 2.0;
    if (Check1(pivot) < Check2(pivot))
      dr = pivot - 1e-7;
    else
      st = pivot + 1e-7;
  }
  cout << setprecision(7) << fixed << max(Check1(st), Check2(dr)) << '\n';
  return 0;
}
