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[222222], b[222222];
int n;
double f(double x) {
  for (int i = 0; i < n; i++) b[i] = a[i] - x;
  double MAX = -0x3f3f3f3f, ans = 0;
  for (int i = 0; i < n; i++) {
    ans += b[i];
    MAX = max(ans, MAX);
    if (ans < 0) ans = 0;
  }
  double MIN = 0x3f3f3f3f;
  ans = 0;
  for (int i = 0; i < n; i++) {
    ans += b[i];
    MIN = min(ans, MIN);
    if (ans > 0) ans = 0;
  }
  return max(fabs(MIN), fabs(MAX));
}
int main() {
  scanf("%d", &n);
  double l = 0x3f3f3f3f, r = -0x3f3f3f3f;
  for (int i = 0; i < n; i++) {
    scanf("%lf", &a[i]);
    l = min(a[i], l);
    r = max(a[i], r);
  }
  while (1) {
    if (r - l <= 1e-11) break;
    double mid = (l + r) / 2;
    double mmid = (mid + r) / 2;
    if (f(mid) <= f(mmid))
      r = mmid;
    else
      l = mid;
  }
  double goal = (l + r) / 2;
  printf("%.15f\n", f(goal));
  return 0;
}
