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 N = 2e5 + 5;
double a[N], b[N], pr[N];
int n;
double f(double d) {
  for (int i = 1; i <= n; i++) {
    b[i] = a[i] - d;
    pr[i] = b[i] + pr[i - 1];
  }
  double ans = abs(b[n]);
  int mkmin = n, mkmax = n;
  for (int i = n - 1; i >= 1; i--) {
    if (pr[i] > pr[mkmax]) mkmax = i;
    if (pr[i] < pr[mkmin]) mkmin = i;
    ans = max(ans, abs(pr[mkmin] - pr[i - 1]));
    ans = max(ans, abs(pr[mkmax] - pr[i - 1]));
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  double l = -1e5, r = 1e5, mid1, mid2;
  for (int i = 1; i <= 300; i++) {
    mid1 = (2 * l + r) / 3;
    mid2 = (l + 2 * r) / 3;
    if (f(mid1) > f(mid2))
      l = mid1;
    else
      r = mid2;
  }
  l = (r + l) / 2;
  cout << fixed << setprecision(6) << f(l);
  return 0;
}
