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 double eps = 1e-6;
double num[210000];
int n;
double Calc(double mid) {
  double ans = 0;
  double sum = 0;
  for (int i = 0; i < n; i++) {
    double m = num[i] - mid;
    if ((sum < 0 && sum + m >= 0) || (sum > 0 && sum + m <= 0)) {
      sum = m;
      ans = max(ans, fabs(sum));
      continue;
    }
    sum += m;
    ans = max(ans, fabs(sum));
  }
  return ans < 0 ? -ans : ans;
}
double Solve(double MIN, double MAX) {
  double Left, Right;
  double mid, midmid;
  double mid_area = 0, midmid_area = 0;
  Left = MIN;
  Right = MAX;
  while (Left + eps < Right) {
    mid = (Left + Right) / 2;
    midmid = (mid + Right) / 2;
    mid_area = Calc(mid);
    midmid_area = Calc(midmid);
    printf("%f %f\n", mid_area, midmid_area);
    if (midmid_area - mid_area > eps)
      Right = midmid;
    else
      Left = mid;
  }
  return Calc(Right);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%lf", &num[i]);
  printf("%.10f\n", Solve(-10000, 10000));
  return 0;
}
