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>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const int N = 200010;
const int M = 100010;
const int Mat = 110;
typedef double Matrix[Mat][Mat];
const double eps = 1e-10;
inline int readint() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int x = 0;
  while ('0' <= c && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x;
}
int buf[10];
inline void writeint(int i) {
  int p = 0;
  if (i == 0)
    p++;
  else
    while (i) {
      buf[p++] = i % 10;
      i /= 10;
    }
}
int n, m;
double A[N], B[N], C[N];
double cal(double x) {
  double y = A[0] - x, ans = fabs(y);
  if (y > 0) {
    B[0] = y;
    C[0] = 0;
  } else {
    B[0] = 0;
    C[0] = y;
  }
  for (int i = 1; i < n; i++) {
    y = A[i] - x;
    B[i] = B[i - 1] + y;
    if (B[i] < 0) B[i] = 0;
    C[i] = C[i - 1] + y;
    if (C[i] > 0) C[i] = 0;
    if (B[i] > ans) ans = B[i];
    if (-C[i] > ans) ans = -C[i];
  }
  return ans;
}
void slove() {
  scanf("%d", &n);
  double l = 0, r = 0, ans = 0.0f, tmp = 1.0f, x, y, p, q;
  for (int i = 0; i < n; i++) {
    scanf("%lf", &A[i]);
    if (A[i] > r) r = A[i];
    if (A[i] < l) l = A[i];
  }
  while (fabs(ans - tmp) > eps) {
    tmp = ans;
    x = l + (r - l) / (3.0f);
    y = r - (r - l) / (3.0f);
    p = cal(x);
    q = cal(y);
    if (p > q) {
      ans = q;
      l = x;
    } else {
      ans = p;
      r = y;
    }
  }
  printf("%.10f", ans);
  return;
}
int main() {
  int i, j, k, T = 1;
  while (T--) {
    slove();
  }
  return 0;
}
