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;
int a[200000], n;
pair<double, double> go(double x) {
  double sum1 = 0, sum2 = 0, mx1 = INT_MIN, mx2 = INT_MAX;
  for (int i = 0; i < (int)(n); i++) {
    sum1 += a[i] - x;
    if (sum1 < 0) sum1 = 0;
    mx1 = max(mx1, sum1);
    sum2 += a[i] - x;
    if (sum2 > 0) sum2 = 0;
    mx2 = min(mx2, sum2);
  }
  return make_pair(mx1, mx2);
}
int main() {
  int mx = INT_MIN, mn = INT_MAX;
  cin >> n;
  for (int i = 0; i < (int)(n); i++) {
    scanf("%d", &a[i]);
    mx = max(mx, a[i]);
    mn = min(mn, a[i]);
  }
  double l = mn, r = mx, ans = l;
  while (r - l > 1e-8) {
    double m = (r + l) / 2.0;
    pair<double, double> qq = go(m);
    if (fabs(fabs(qq.first) - fabs(qq.second)) < 1e-9) {
      ans = m;
      break;
    } else if (fabs(qq.first) > fabs(qq.second))
      r = m;
    else
      l = m;
  }
  printf("%.9lf\n", fabs(go(ans).first));
}
