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;
#pragma comment(linker, "/STACK:102400000,102400000")
void RI(int& x) {
  x = 0;
  char c = getchar();
  while (c == ' ' || c == '\n') c = getchar();
  bool flag = 1;
  if (c == '-') {
    flag = 0;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  if (!flag) x = -x;
}
void RII(int& x, int& y) { RI(x), RI(y); }
void RIII(int& x, int& y, int& z) { RI(x), RI(y), RI(z); }
const int maxn = 1e5 + 1000;
const double eps = 1e-11;
int n;
int a[maxn << 1];
double b[maxn << 1];
double cal(double x) {
  double res = 0;
  double now = 0;
  for (int i = 0; i < n; i++) b[i] = a[i] * 1.0 - x;
  for (int i = 0; i < n; i++) {
    now += b[i];
    if (now < 0) now = 0;
    res = max(res, now);
    b[i] = -b[i];
  }
  now = 0;
  for (int i = 0; i < n; i++) {
    now += b[i];
    if (now < 0) now = 0;
    res = max(res, now);
  }
  return res;
}
int main() {
  RI(n);
  for (int i = 0; i < n; i++) RI(a[i]);
  double tmp = 0;
  double l = -10000, r = 10000, mid1, mid2;
  double ans1, ans2;
  int t = 100;
  while (t--) {
    mid1 = l + (r - l) / 3;
    mid2 = r - (r - l) / 3;
    ans1 = cal(mid1);
    ans2 = cal(mid2);
    if (ans1 > ans2)
      l = mid1;
    else
      r = mid2;
  }
  printf("%.6f\n", cal(l));
  return 0;
}
