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;
double a[200001];
double weakness(double x) {
  double best_sum = 0.0;
  double curr_sum = 0.0;
  for (int i = 0; i < n; i++) {
    curr_sum += a[i] - x;
    best_sum = max(best_sum, curr_sum);
    if (curr_sum < 0.0) {
      curr_sum = 0.0;
    }
  }
  curr_sum = 0.0;
  for (int i = 0; i < n; i++) {
    curr_sum -= a[i] - x;
    best_sum = max(best_sum, curr_sum);
    if (curr_sum < 0.0) {
      curr_sum = 0.0;
    }
  }
  return best_sum;
}
double ternary_search(double l, double r) {
  double error = 1e-9;
  while (r - l > error) {
    double m1 = l + (r - l) / 3;
    double m2 = r - (r - l) / 3;
    double f1 = weakness(m1);
    double f2 = weakness(m2);
    if (f1 < f2)
      r = m2;
    else
      l = m1;
  }
  return weakness(l);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    cin >> n;
    double mi = 2e6;
    double ma = -2e6;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      mi = min(a[i], mi);
      ma = max(a[i], ma);
    }
    std::cout << setprecision(9) << ternary_search(mi - 1, ma + 1) << endl;
  }
  return 0;
}
