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;
long long n;
long long a[200005];
double fn(double x) {
  double ret = 0;
  double cur = 0, mx = 0, ans1 = 0, ans2 = 0;
  for (long long(i) = 0; (i) < (n); (i)++) {
    cur += a[i] - x;
    ans1 = max(ans1, cur);
    cur = max(0.0, cur);
  }
  cur = 0;
  for (long long(i) = 0; (i) < (n); (i)++) {
    cur += a[i] - x;
    ans2 = min(ans2, cur);
    cur = min(0.0, cur);
  }
  return max(abs(ans1), abs(ans2));
}
long long check(double x) {
  if (fn(x + 1e-7) < fn(x + 1e-7)) return 1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long(i) = 0; (i) < (n); (i)++) cin >> a[i];
  double l = -10000, r = 10000;
  int cnt = 0;
  while (r - l > 1e-7) {
    cnt++;
    if (cnt == 120) break;
    double m = (l + r) / 2;
    if (check(m) == 1)
      r = m;
    else
      l = m;
  }
  cout << fixed << setprecision(10) << fn(l) << "\n";
  return 0;
}
