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 segextreme(double* arr, double offset, int len, double& segmax,
                double& segmin) {
  double new_array[len + 1];
  new_array[0] = 0;
  for (int i = 0; i < len; i++)
    new_array[i + 1] = new_array[i] + arr[i] - offset;
  double minsf = 0;
  double maxsf = 0;
  segmax = 0;
  segmin = 0;
  for (int i = 0; i < len + 1; i++) {
    if (new_array[i] < minsf) minsf = new_array[i];
    if (new_array[i] > maxsf) maxsf = new_array[i];
    if (new_array[i] - maxsf < segmin) segmin = new_array[i] - maxsf;
    if (new_array[i] - minsf > segmax) segmax = new_array[i] - minsf;
  }
}
int main(int argc, char* argv[]) {
  int N;
  cin >> N;
  double source[N];
  for (int i = 0; i < N; i++) cin >> source[i];
  double hi, lo;
  hi = 10000.0;
  lo = -10000.0;
  double segmax, segmin;
  while (hi - lo > .000001) {
    double mid = 0.5 * (hi + lo);
    segextreme(source, mid, N, segmax, segmin);
    if (-segmin > segmax) {
      hi = mid;
    } else {
      lo = mid;
    }
  }
  cout << -segmin << endl;
  return 0;
}
