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 n, a[(int)2e5 + 10];
long double WeekNess, mx = -1e18, mn = 1e18, sum;
long double Answer(long double Check) {
  mx = 0, mn = 0, sum = 0, WeekNess = 0;
  for (int i = 0; i < n; i++) {
    mx = max(mx, sum);
    mn = min(mn, sum);
    sum += a[i] - Check;
    WeekNess = max(WeekNess, fabs(sum - mx));
    WeekNess = max(WeekNess, fabs(sum - mn));
  }
  return WeekNess;
}
long double BinarySol(long double l, long double r) {
  long double mid1 = (2 * l + r) / 3;
  long double mid2 = (2 * r + l) / 3;
  int c = 0;
  while (c++ <= 200) {
    mid1 = (2 * l + r) / 3;
    mid2 = (2 * r + l) / 3;
    if (Answer(mid1) >= Answer(mid2)) {
      l = mid1;
    } else {
      r = mid2;
    }
  }
  return l;
}
int main() {
  cin >> n;
  for (int i = 0; i < n && scanf("%d", a + i); i++)
    ;
  cout << setprecision(6) << fixed << Answer(BinarySol(-1e10, 1e10));
}
