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 = 1e9;
const int MOD = 1e9 + 7;
const int N = 2e5 + 10;
const double eps = 1e-9;
int n, a[N];
double cal(double x) {
  double ans = 0, cur = 0;
  for (auto i = 1; i <= n; i++) {
    cur = max(.0, cur + a[i] - x);
    ans = max(ans, cur);
  }
  cur = 0;
  for (auto i = 1; i <= n; i++) {
    cur = max(.0, cur + x - a[i]);
    ans = max(ans, cur);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (auto i = 1; i <= n; i++) scanf("%d", a + i);
  double L = -1e4, R = 1e4;
  for (auto phase = 1; phase <= 300; phase++) {
    double L1 = L + (R - L) / 3, R1 = R - (R - L) / 3;
    if (cal(L1) > cal(R1))
      L = L1;
    else
      R = R1;
  }
  printf("%.9f", cal(L));
}
