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;
double a[200010];
int n;
double f(double x) {
  double sum = 0, mx = 0, mn = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i] - x;
    mx = max(mx, sum);
    mn = min(sum, mn);
  }
  return (mx - mn);
}
int main() {
  while (scanf("%d", &n) == 1) {
    for (int i = 0; i < n; i++) cin >> a[i];
    double l = -10001, r = 10001, ml, mr, z1, z2;
    while (abs(r - l) <= 0.0000001) {
      ml = (l + r) / 2.0;
      mr = (ml + r) / 2.0;
      z1 = f(mr), z2 = f(ml);
      if (z1 < z2)
        l = ml;
      else
        r = mr;
    }
    l = (l + r) / 2.0;
    cout << fixed << setprecision(10) << f(l);
  }
  return 0;
}
