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;
void fio() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
double solve(double mid, vector<double> vec, double n) {
  for (int i = 0; i < n; i++) {
    vec[i] = vec[i] - mid;
  }
  double cur_sum = vec[0], max_sum = vec[0];
  double cur_min = vec[0], min_sum = vec[0];
  for (int i = 1; i < n; i++) {
    cur_sum = max(cur_sum + vec[i], vec[i]);
    max_sum = max(max_sum, cur_sum);
    cur_min = min(cur_min + vec[i], vec[i]);
    min_sum = min(cur_min, min_sum);
  }
  return max(max_sum, abs(min_sum));
}
int main() {
  fio();
  cout << fixed << setprecision(14);
  double n;
  cin >> n;
  vector<double> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
  }
  double l = -(1e4 + 7), r = 1e4 + 7;
  for (int i = 0; i < 300; i++) {
    double m1 = l + (r - l) / 3;
    double m2 = r - (r - l) / 3;
    double f1 = solve(m1, vec, n);
    double f2 = solve(m2, vec, n);
    if (f1 < f2)
      r = m2;
    else
      l = m1;
  }
  double mid = r;
  for (int i = 0; i < n; i++) {
    vec[i] = vec[i] - mid;
  }
  double cur_sum = vec[0], max_sum = vec[0];
  double cur_min = vec[0], min_sum = vec[0];
  for (int i = 1; i < n; i++) {
    cur_sum = max(cur_sum + vec[i], vec[i]);
    max_sum = max(max_sum, cur_sum);
    cur_min = min(cur_min + vec[i], vec[i]);
    min_sum = min(cur_min, min_sum);
  }
  cout << max(max_sum, abs(min_sum)) << endl;
  return 0;
}
