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 a[200005];
long double b[200005];
int n;
long double solve() {
  long double ans = -1e18;
  long double sum1 = 0, sum2 = 0;
  for (int i = 1; i <= n; i++) {
    sum1 = max(b[i], sum1 + b[i]);
    ans = max(ans, sum1);
    b[i] = -b[i];
    sum2 = max(b[i], sum2 + b[i]);
    ans = max(ans, sum2);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  long double lo = 0, hi = 1e9, ans = 1e9;
  for (int i = 0; i < 200; i++) {
    long double mid1 = lo + (hi - lo) / 3;
    long double mid2 = hi - (hi - lo) / 3;
    long double res1 = -1e18, res2 = -1e18;
    for (int i = 1; i <= n; i++) {
      b[i] = a[i] - mid1;
    }
    res1 = solve();
    for (int i = 1; i <= n; i++) {
      b[i] = a[i] - mid2;
    }
    res2 = solve();
    if (res1 <= res2) {
      ans = min(ans, res1);
      hi = mid2;
    } else {
      ans = min(ans, res2);
      lo = mid1;
    }
  }
  printf("%.20Lf\n", ans);
}
