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 a[200010], n;
double Get_weekness(double x) {
  double k1 = 0.0, k2 = 0.0, res = 0.0;
  for (int i = 0; i < n; i++) {
    k1 += a[i] - x;
    k2 += a[i] - x;
    if (k1 < 0) k1 = 0.0;
    if (k2 > 0) k2 = 0.0;
    if (k1 > res) res = k1;
    if (-k2 > res) res = -k2;
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  double l = -99999.99, r = 99999.99;
  for (int i = 0; i < 100; i++) {
    double k1 = l / 3 * 2 + r / 3;
    double k2 = l / 3 + r / 3 * 2;
    if (Get_weekness(k1) > Get_weekness(k2))
      l = k1;
    else
      r = k2;
  }
  printf("%.12f\n", Get_weekness(l));
  return 0;
}
