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 N = 2e5 + 5;
int n, a[N];
double f[N][2];
double check(double mid) {
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    f[i][0] = f[i][1] = a[i] - mid;
    if (f[i - 1][0] > 0) f[i][0] += f[i - 1][0];
    if (f[i - 1][1] < 0) f[i][1] += f[i - 1][1];
    ans = max(ans, fabs(f[i][0]));
    ans = max(ans, fabs(f[i][1]));
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  double l = -100000, r = 100000;
  for (int i = 1; i <= 50; i++) {
    double mid1 = (l * 2 + r) / 3, mid2 = (l + 2 * r) / 3;
    if (check(mid1) < check(mid2))
      r = mid2;
    else
      l = mid1;
  }
  printf("%.10f\n", check(l));
}
