#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
const int maxn = 2e5 + 5;
inline long long read() {
  long long ans = 0;
  char ch = getchar(), last = ' ';
  while (!isdigit(ch)) {
    last = ch;
    ch = getchar();
  }
  while (isdigit(ch)) {
    ans = ans * 10 + ch - '0';
    ch = getchar();
  }
  if (last == '-') ans = -ans;
  return ans;
}
inline void write(long long x) {
  if (x < 0) x = -x, putchar('-');
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
int n, a[maxn];
double calc(double x) {
  double Min = 0, Max = 0, ans = 0;
  for (int i = 1; i <= n; ++i) {
    Min = Min + a[i] - x > 0 ? 0 : Min + a[i] - x;
    Max = Max + a[i] - x < 0 ? 0 : Max + a[i] - x;
    ans = max(ans, max(Max, -Min));
  }
  return ans;
}
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  double L = -10000, R = 10000, x;
  for (int i = 1; i <= 100; ++i) {
    double m1 = L + (R - L) / 3.00;
    double m2 = R - (R - L) / 3.00;
    if (calc(m1) <= calc(m2))
      x = m1, R = m2;
    else
      x = m2, L = m1;
  }
  printf("%.8lf\n", calc(x));
  return 0;
}
