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 double eps = 1e-11;
int n;
int a[200010];
double b[200010];
double l = -20000, r = 20000, ans = 2147483647, w1, w2, v1, v2;
double make(double x) {
  double maxh = -2147483647, tmp = 0, minh = 2147483647;
  for (int i = 1; i <= n; i++) b[i] = a[i] - x;
  for (int i = 1; i <= n; i++) {
    if (tmp < 0)
      tmp = b[i];
    else
      tmp += b[i];
    if (tmp > maxh) maxh = tmp;
  }
  tmp = 0;
  for (int i = 1; i <= n; i++) {
    if (tmp > 0)
      tmp = b[i];
    else
      tmp += b[i];
    if (tmp < minh) minh = tmp;
  }
  return max(maxh, -minh);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= 200; i++) {
    w1 = l + (r - l) / 3;
    w2 = r - (r - l) / 3;
    v1 = make(w1);
    v2 = make(w2);
    if (v1 < v2)
      r = w2, ans = min(ans, v1);
    else
      l = w1, ans = min(ans, v2);
  }
  printf("%.15lf", ans);
  return 0;
}
