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 t[200005];
int n, k;
double cal(double x) {
  double maxx = 0, minn = 0;
  for (int i = 1; i <= n; i++) {
    double val = -x * i + t[i];
    maxx = max(maxx, val);
    minn = min(minn, val);
  }
  return maxx - minn;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  t[0] = 0;
  for (int i = 1; i <= n; i++) cin >> k, t[i] = t[i - 1] + k;
  double l = -30000, h = 30000;
  int cc = 0;
  for (int i = 1; i <= 100; i++) {
    cc++;
    double r1 = l + (h - l) / 3;
    double r2 = l + (h - l) * 2 / 3;
    double R1 = cal(r1);
    double R2 = cal(r2);
    if (R1 < R2 + 1e-8)
      h = r2;
    else
      l = r1;
  }
  printf("%.9lf", cal((l + h) / 2));
  return 0;
}
