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 a[200010];
double w[200010];
int N;
double check(double x) {
  double ans = 0, tmp = 0;
  for (int i = 0; i < N; i++) {
    if (tmp < 0) tmp = 0;
    tmp += (a[i] - x);
    ans = max(ans, fabs(tmp));
  }
  tmp = 0;
  for (int i = 0; i < N; i++) {
    if (tmp > 0) tmp = 0;
    tmp += (a[i] - x);
    ans = max(ans, fabs(tmp));
  }
  return ans;
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%lf", &a[i]);
  }
  double l = -1e4, r = 1e4;
  for (int i = 0; i < 100; i++) {
    double d = (r - l) / 3;
    double m1 = l + d, m2 = r - d;
    double c1 = check(m1), c2 = check(m2);
    if (c1 > c2)
      l = m1;
    else
      r = m2;
  }
  printf("%.9f\n", check((l + r) / 2));
  return 0;
}
