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 = 1234567;
const double eps = 1e-11;
const int inf = (int)2e9;
const int mod = (int)1e9 + 7;
double a[200009];
double b[200009];
int n;
double get() {
  double sum = 0;
  double ans = 0;
  for (int i = 0; i < n; ++i) {
    if (b[i] + sum < 0)
      sum = 0;
    else
      sum = sum + b[i];
    ans = max(ans, sum);
  }
  return ans;
}
double f(double k) {
  double ret = 0;
  for (int i = 0; i < n; ++i) b[i] = a[i] - k;
  ret = get();
  for (int i = 0; i < n; ++i) b[i] = -b[i];
  ret = max(ret, get());
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%lf", a + i);
  }
  int cnt = 400;
  double l = -1e10, r = 1e10;
  while (cnt--) {
    double m1 = l + (r - l) / 3, m2 = r - (r - l) / 3;
    if (f(m1) > f(m2))
      l = m1;
    else
      r = m2;
  }
  cout << fixed << setprecision(16) << f(r) << "\n";
  return 0;
}
