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 = 200000;
int sum[N + 10];
int main() {
  int n, num;
  double ans;
  while (~scanf("%d", &n)) {
    memset(sum, 0, sizeof(sum));
    scanf("%d", &num);
    sum[0] = num;
    for (int i = 1; i < n; i++) {
      scanf("%d", &num);
      sum[i] = sum[i - 1] + num;
    }
    double left, right, midL, midR;
    double a, b, c, d;
    double flag;
    left = -10000, right = 10000;
    int Z = 110;
    while (Z--) {
      midL = (right - left) / 3 + left;
      midR = (right - left) * 2 / 3 + left;
      a = b = c = d = 0;
      for (int i = 0; i < n; i++) {
        flag = sum[i] + midL * (i + 1);
        a = max(a, flag);
        b = min(b, flag);
        flag = sum[i] + midR * (i + 1);
        c = max(c, flag);
        d = min(d, flag);
      }
      if (a - b > c - d) {
        left = midL;
        ans = c - d;
      } else {
        right = midR;
        ans = a - b;
      }
    }
    printf("%.15lf\n", ans);
  }
  return 0;
}
