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 maxn = 2e5 + 10;
double a[maxn], b[maxn];
int n;
double mcs() {
  double ans = 0, cur = 0;
  for (int i = 0; i < n; i++) {
    cur += b[i];
    if (cur > ans) ans = cur;
    if (cur < 0) cur = 0;
  }
  return ans;
}
void calc(double mid, double &a1, double &a2) {
  for (int i = 0; i < n; i++) b[i] = a[i] - mid;
  a1 = mcs();
  for (int i = 0; i < n; i++) b[i] = mid - a[i];
  a2 = mcs();
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &a[i]);
  double l = -1e9, r = 1e9, ans = 1e18;
  for (int i = 0; i < 100; i++) {
    double mid = (l + r) / 2, a1, a2;
    calc(mid, a1, a2);
    if (a1 > a2)
      l = mid;
    else
      r = mid;
    ans = min(ans, max(a1, a2));
  }
  printf("%.12f\n", ans);
  return 0;
}
