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;
double ar[200009], pr[200009];
int N;
double solve(double x) {
  int i;
  double ans, temp;
  for (i = 1; i <= N; i++) {
    pr[i] = ar[i] - x;
  }
  ans = 0.0;
  temp = 0.0;
  for (i = 1; i <= N; i++) {
    temp += pr[i];
    ans = max(ans, temp);
    if (temp < 0) {
      temp = 0.0;
    }
  }
  for (i = 1; i <= N; i++) {
    pr[i] = -pr[i];
  }
  temp = 0.0;
  for (i = 1; i <= N; i++) {
    temp += pr[i];
    ans = max(ans, temp);
    if (temp < 0) {
      temp = 0.0;
    }
  }
  return ans;
}
int main() {
  int cnt, i;
  double templeft, tempright, z, x, left, right;
  cin >> N;
  for (i = 1; i <= N; i++) cin >> ar[i];
  left = -30000;
  right = 30000;
  cnt = 0;
  while (cnt <= 150) {
    cnt++;
    templeft = left * 2.0 / 3.0 + right / 3.0;
    tempright = right * 2.0 / 3.0 + left / 3.0;
    z = solve(templeft);
    x = solve(tempright);
    if (z > x) {
      left = templeft;
    } else {
      right = tempright;
    }
  }
  printf("%.10lf\n", z);
}
