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 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;
}
