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>
int a[200000];
double diff[200000];
double getAns(int n, double x) {
  for (int i = 0; i < n; i++) {
    diff[i] = a[i] - x;
  }
  double small = 0, big = 0, min = 0, max = 0;
  for (int i = 0; i < n; i++) {
    small += diff[i];
    min = std::min(min, small);
    if (small > 0) small = 0;
    big += diff[i];
    max = std::max(max, big);
    if (big < 0) big = 0;
  }
  return std::max(max, -min);
}
double trinarySearch(int n, double left, double right) {
  int t = 100;
  while (t--) {
    double mid1 = left + (right - left) / 3;
    double mid2 = left + 2 * (right - left) / 3;
    double ans1 = getAns(n, mid1);
    double ans2 = getAns(n, mid2);
    if (ans1 == ans2) {
      left = mid1;
      right = mid2;
    } else if (ans1 < ans2) {
      right = mid2;
    } else {
      left = mid1;
    }
  }
  return (left + right) / 2;
}
int main() {
  int n;
  scanf("%d", &n);
  int max = -10000, min = 10000;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (max < a[i]) max = a[i];
    if (min > a[i]) min = a[i];
  }
  double x = trinarySearch(n, min, max);
  printf("%.10f\n", getAns(n, x));
  return 0;
}
