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 maxN = 2e5 + 100;
int n, k, x;
int a[maxN];
double s[maxN];
double tim() {
  double res = s[1], sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += s[i];
    res = max(res, sum);
    if (sum < 0) sum = 0;
  }
  return res;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%i", &a[i]);
  double res = 1e18;
  double l = -1e9, r = 1e9;
  int dem = 100;
  while (dem--) {
    double mid = (l + r) / 2;
    for (int i = 1; i <= n; i++) s[i] = double(a[i]) - mid;
    double s1 = tim();
    for (int i = 1; i <= n; i++) s[i] = -s[i];
    double s2 = tim();
    res = min(max(abs(s1), abs(s2)), res);
    if (abs(s1) > abs(s2))
      l = mid;
    else
      r = mid;
  }
  printf("%.9f", res);
  return 0;
}
