#include <bits/stdc++.h>
using namespace std;
template <class T>
void rd(T &res) {
  res = 0;
  char c;
  int k = 1;
  while (c = getchar(), c < '0')
    if (c == '-') k = -k;
  do {
    res = (res << 1) + (res << 3) + (c ^ 48);
  } while (c = getchar(), c >= '0');
  res *= k;
}
template <class T>
void pt(T k) {
  if (k == 0) return;
  pt(k / 10);
  putchar((k % 10) ^ 48);
}
template <class T>
void sc(T k) {
  pt(k);
  if (k == 0) putchar('0');
  putchar('\n');
}
template <class T>
void MIN(T &a, T b) {
  if (b == -1) return;
  if (a == -1 || a > b) a = b;
}
template <class T>
void MAX(T &a, T b) {
  if (a < b) a = b;
}
const int M = 2e5 + 5;
int A[M];
int n;
double ans = 2e9;
inline void input() {
  int i, j, k;
  rd(n);
  for (int i = 1, i_END_ = n; i <= i_END_; ++i) rd(A[i]);
}
inline bool check(double x) {
  int i, j, k;
  double a[2], b[2];
  memset(a, 0, sizeof(a));
  memset(b, -0x3f, sizeof(b));
  for (int i = 1, i_END_ = n; i <= i_END_; ++i) {
    a[0] += A[i] - x;
    a[1] += x - A[i];
    b[0] = max(b[0], a[0]);
    b[1] = max(b[1], a[1]);
    if (a[0] < 0) a[0] = 0;
    if (a[1] < 0) a[1] = 0;
  }
  ans = min(ans, max(b[0], b[1]));
  return b[0] > b[1];
}
inline void solve() {
  int i, j, k;
  double l = -1e9, r = 1e9, mid;
  for (int i = 1, i_END_ = 100; i <= i_END_; ++i) {
    mid = 1.0 * (l + r) / 2;
    if (check(mid))
      l = mid;
    else
      r = mid;
  }
  printf("%.15lf\n", ans);
}
int main() {
  input();
  solve();
  return 0;
}
