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>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int n;
int num[200010];
double no[200010], sum[200010];
double cal(double x) {
  for (int i = 1; i <= n; i++) {
    no[i] = num[i] - x;
  }
  double ans = 0;
  double max1 = 0;
  for (int i = 1; i <= n; i++) {
    max1 += no[i];
    if (max1 < 0) {
      max1 = 0;
    }
    ans = max(ans, max1);
  }
  max1 = 0;
  for (int i = 1; i <= n; i++) {
    no[i] = -no[i];
    max1 += no[i];
    if (max1 < 0) {
      max1 = 0;
    }
    ans = max(ans, max1);
  }
  return ans;
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &num[i]);
    }
    double left = -10000, right = 10000;
    for (int i = 0; i < 100; i++) {
      double mid = (left + right) / 2;
      double midmid = (mid + right) / 2;
      double mid_ans = cal(mid);
      double midmid_ans = cal(midmid);
      if (mid_ans < midmid_ans) {
        right = midmid;
      } else {
        left = mid;
      }
    }
    printf("%.20lf\n", cal(right));
  }
  return 0;
}
