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 mn = 200010;
const double inf = 1e18;
int a[mn], n;
double check(double x) {
  double sum = 0, ret = 0, Min = 0, Max = 0;
  for (int i = 1; i <= n; i++) {
    sum += a[i] - x;
    ret = max(ret, fabs(sum - Min));
    ret = max(ret, fabs(sum - Max));
    Min = min(Min, sum);
    Max = max(Max, sum);
  }
  return ret;
}
int main() {
  double l = 0, r;
  int cnt = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    l = min(l, -fabs(a[i]));
  }
  r = -l;
  for (int i = 1; i <= 300; i++) {
    double ml = (r - l) / 3.0 + l, mr = (r - l) / 3.0 * 2.0 + l;
    if (check(ml) < check(mr))
      r = mr;
    else
      l = ml;
  }
  cout << fixed << setprecision(6) << check((l + r) * 0.5);
  return 0;
}
