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 N = 2e5 + 11;
long long a[N];
int n;
double maxpoor(double x) {
  double min_sum = 0.0;
  double max_sum = 0.0;
  double cur_sum = 0.0;
  double ans = 0.0;
  for (int i = 1; i <= n; i++) {
    cur_sum += a[i] - x;
    ans = max(ans, fabs(cur_sum - min_sum));
    ans = max(ans, fabs(cur_sum - max_sum));
    min_sum = min(min_sum, cur_sum);
    max_sum = max(max_sum, cur_sum);
  }
  return ans;
}
int main() {
  while (1 == scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    double lo = -1e5, hi = 1e5;
    for (int i = 0; i < 200; i++) {
      double left = lo + (hi - lo) / 3.0;
      double right = hi - (hi - lo) / 3.0;
      if (maxpoor(left) < maxpoor(right))
        hi = right;
      else
        lo = left;
    }
    printf("%.8f\n", maxpoor(lo));
  }
  return 0;
}
