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 b[300001], sum[300001];
int a[300001];
int n;
double check(double x) {
  for (int i = 1; i <= n; i++) b[i] = a[i] * 1.0 - x;
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + b[i];
  double Min = 0.0, Max = 0.0;
  double ans = 0.0;
  for (int i = 1; i <= n; i++) {
    ans = max(ans, fabs(sum[i] - Min));
    ans = max(ans, fabs(sum[i] - Max));
    Min = min(Min, sum[i]);
    Max = max(Max, sum[i]);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  double l = -999999.0, r = 999999.0;
  double ans = 9999999999999.0;
  bool flag = false;
  for (int i = 1; i <= 200; i++) {
    double mid1 = l + (r - l) / 3.0, mid2 = r - (r - l) / 3.0;
    double tmpx = check(mid1), tmpy = check(mid2);
    if (tmpx > tmpy)
      l = mid1;
    else
      r = mid2;
    if (flag == false) {
      flag = true;
      ans = tmpx;
    } else
      ans = min(ans, tmpx);
    ans = min(ans, tmpy);
  }
  ans = min(ans, check(l));
  printf("%.9f\n", ans);
  return 0;
}
