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 V[400000];
int n;
double check(double x, bool output = 0) {
  double s1 = 0, s2 = 0;
  double best1 = -1e16, best2 = -1e16;
  for (int i = 1; i <= n; i++) {
    if (V[i] < x) {
      s2 = 0;
      s1 += x - V[i];
    } else {
      s1 = 0;
      s2 += V[i] - x;
    }
    best1 = max(best1, s1);
    best2 = max(best2, s2);
  }
  if (output) cout << fixed << setprecision(12) << max(best1, best2);
  return best1 - best2;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> V[i];
  }
  double l = -20000, r = 20000;
  while (r - l > 1e-8) {
    double m = (l + r) / 2;
    if (check(m) > 0)
      r = m;
    else
      l = m;
  }
  double s1 = 0, s2 = 0;
  for (int i = 1; i <= n; i++) {
    if (V[i] < l)
      s1 += l - V[i];
    else
      s2 += V[i] - l;
  }
  check(l, 1);
  return 0;
}
