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;
int arr[200002];
double minend[200002];
double maxend[200002];
int n;
double eps = ((double)1) / ((double)100000000000ll);
double a = -200000, b = 200000;
double po(double x) {
  double ans = 0;
  minend[0] = arr[0] - x;
  maxend[0] = arr[0] - x;
  ans = max(minend[0], 0 - minend[0]);
  for (int i = 1; i < n; ++i) {
    minend[i] = arr[i] - x;
    maxend[i] = arr[i] - x;
    if (minend[i - 1] < 0) minend[i] += minend[i - 1];
    if (maxend[i - 1] > 0) maxend[i] += maxend[i - 1];
    ans = max(ans, max(minend[i], 0 - minend[i]));
    ans = max(ans, max(maxend[i], 0 - maxend[i]));
  }
  return max(ans, 0 - ans);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &arr[i]);
  while (max(a - b, b - a) > eps) {
    double p, q;
    double l = b - a;
    if (l < 0) break;
    p = a + l / 3;
    q = p + l / 3;
    double x = po(p), y = po(q);
    if (y > x)
      b = q;
    else
      a = p;
  }
  double ans = po(a);
  printf("%0.6lf\n", ans);
  return 0;
}
