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 weakness(vector<int> &v, double x) {
  double smin = 0, smax = 0, best = 0, cur;
  for (int i = 0; i < v.size(); i++) {
    cur = v[i] - x;
    smin = min(cur, smin + cur);
    smax = max(cur, smax + cur);
    best = max({best, abs(smax), abs(smin)});
  }
  return best;
}
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  double l = -10000, r = 10000;
  for (int i = 0; i < 60; i++) {
    double m = (l + r) / 2;
    if (weakness(v, m) >= weakness(v, m + 1e-12))
      l = m;
    else
      r = m;
  }
  printf("%.9lf\n", weakness(v, l));
}
