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;
int n;
int a[200002];
pair<double, int> weakness(double x) {
  double mini = 0, maxi = 0, p = 0, g = 0;
  for (int i = 1; i < n + 1; i++) {
    if (mini > a[i] - x * i) {
      p = i;
      mini = a[i] - x * i;
    }
    if (maxi < a[i] - x * i) {
      g = i;
      maxi = a[i] - x * i;
    }
  }
  return make_pair(maxi - mini, g - p);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n + 1; i++) scanf("%d", &a[i]);
  for (int i = 2; i < n + 2; i++) a[i] += a[i - 1];
  double l = -1000000000, r = 1000000000;
  pair<double, int> wt;
  for (int i = 0; i < 80; i++) {
    wt = weakness((l + r) / 2);
    if (wt.second == 0) {
      printf("0\n");
      return 0;
    }
    if (wt.second > 0)
      l = (l + r) / 2;
    else
      r = (l + r) / 2;
  }
  printf("%.7lf\n", wt.first);
}
