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 int OnlineJudge = 0;
const int maxn = 200000 + 1912;
const long long INF = 1000LL * 1000 * 1000 * 1000;
const long double eps = 1e-10;
int n;
int a[maxn];
long long sum[maxn];
void ReadData() {
  cin >> n;
  for (int _a = 1, _b = n, i = _a; i <= n; i++) cin >> a[i];
  for (int _a = 1, _b = n, i = _a; i <= n; i++) sum[i] = sum[i - 1] + a[i];
}
long double f(long double x) {
  long double mn = 0, mx = 0;
  for (int _a = 1, _b = n, i = _a; i <= n; i++) {
    mn = min(mn, sum[i] - x * (long long)i);
    mx = max(mx, sum[i] - x * (long long)i);
  }
  return abs(mx - mn);
}
long double Rand(const int low, const int &high) {
  return (long long)rand() * long long(rand()) % (high - low + 1) + low;
}
void Process() {
  long double low = (long double)*min_element(a + 1, a + 1 + n),
              high = (long double)*max_element(a + 1, a + 1 + n);
  long double res = INF;
  for (int Try = 0, _a = 24; Try < _a; Try++) {
    long double x = Rand((int)low, (int)high);
    long double delta = 1e10, cur = f(x);
    while (delta > eps) {
      long double l = x - delta, r = x + delta;
      long double valL = f(l), valR = f(r);
      if (valL < cur && valL < valR) {
        x = l;
        cur = valL;
      } else if (valR < cur && valR < valL) {
        x = r;
        cur = valR;
      }
      delta /= 2;
    }
    res = min(res, cur);
  }
  cout << fixed << setprecision(9);
  cout << res << "\n";
}
int main() {
  std ::ios_base::sync_with_stdio(false);
  cin.tie(0);
  srand(time(NULL));
  ReadData();
  Process();
  return 0;
}
