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;
const long long M = 1e9 + 7;
const long long P = 31;
long double weakness(vector<long double> &seq, long double x) {
  long double min_v = 0, max_v = 0;
  for (int i = 0; i != seq.size(); ++i) {
    long double value = seq[i] - (i + 1) * x;
    min_v = min(min_v, value);
    max_v = max(max_v, value);
  }
  return max_v - min_v;
}
int main() {
  int n;
  cin >> n;
  vector<long double> seq(n);
  for (int i = 0; i != n; ++i) {
    long double num;
    cin >> num;
    if (i == 0)
      seq[i] = num;
    else
      seq[i] = seq[i - 1] + num;
  }
  long double left = -10000, right = 10000;
  const long double eps = 1e-9;
  while (right - left > eps) {
    long double m1 = left + (right - left) / 3;
    long double m2 = right - (right - left) / 3;
    long double v1 = weakness(seq, m1);
    long double v2 = weakness(seq, m2);
    if (v1 < v2)
      right = m2;
    else
      left = m1;
  }
  cout << weakness(seq, left) << '\n';
  return 0;
}
