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;
double max1, sum, a[200001], b[200001], n;
double f(double y) {
  max1 = 0;
  long long i;
  double sum1 = 0, sum2 = 0;
  for (i = 1; i <= n; i++) a[i] = b[i];
  for (i = 1; i <= n; i++) a[i] -= y;
  for (i = 1; i <= n; i++) {
    sum1 += a[i];
    sum2 += a[i];
    max1 = max(max1, max(abs(sum1), abs(sum2)));
    if (sum2 < 0) sum2 = 0;
    if (sum1 > 0) sum1 = 0;
  }
  return max1;
}
int main() {
  double ri, le, ri1, le1;
  long long i, j;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> b[i];
  le = -10000;
  ri = 10000;
  le1 = le + (ri - le) / 3;
  ri1 = ri - (ri - le) / 3;
  while (1) {
    if (ri - le < 0.00000000001) {
      max1 = f((ri + le) / 2);
      ;
      break;
    } else {
      le1 = le + (ri - le) / 3;
      ri1 = ri - (ri - le) / 3;
      if (f(le1) > f(ri1)) {
        le = le1;
      } else {
        ri = ri1;
      }
    }
  }
  cout.precision(15);
  cout << fixed << max1;
  return 0;
}
