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 n, a[200001];
const long double esl = 1e-15;
double cal(double x) {
  long double t = 0;
  long double ans = 0;
  for (int i = 1; i <= n; i++) {
    if (t + a[i] - x < 0) {
      ans = max(ans, t);
      t = 0;
    } else {
      t += ((long double)a[i] - x);
      ans = max(ans, t);
    }
  }
  ans = max(ans, t);
  long double t1 = 0;
  for (int i = 1; i <= n; i++) {
    if (t1 + a[i] - x > 0) {
      ans = max(ans, -t1);
      t1 = 0;
    } else {
      t1 += ((long double)a[i] - x);
      ans = max(ans, -t1);
    }
  }
  ans = max(ans, -t1);
  return ans;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long double l = -(1e9) - 1;
  long double r = 1e9 + 1;
  while (abs(r - l) >= esl) {
    long double d = (2 * l + r) / 3;
    long double c = (2 * r + l) / 3;
    if (cal(d) > cal(c)) {
      l = d;
    } else
      r = c;
  }
  cout.precision(20);
  cout << cal(l);
  return 0;
}
