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;
vector<int> v1;
pair<int, int> p1;
double a[1234567];
string s;
int dp[1001];
double max1 = 0.0000000000, max2 = 0.00000000;
double b[200001];
int n;
double check(double b[]) {
  int i;
  double max_upto = 0.0000, overall = 0.0000;
  for (i = 0; i < n; i++) {
    max_upto += b[i];
    if (max_upto > overall) overall = max_upto;
    if (max_upto < 0) max_upto = 0;
  }
  return overall;
}
int main() {
  int t;
  int i, j, k, m;
  scanf("%d", &n);
  for (i = 0; i < n; i++) cin >> a[i];
  double l = -1000000000.0000;
  double h = 1000000000, mid;
  for (j = 0; j < 100; j++) {
    mid = (l + h) / 2;
    for (i = 0; i < n; i++) b[i] = a[i] - mid;
    max1 = check(b);
    for (i = 0; i < n; i++) b[i] *= (-1);
    max2 = check(b);
    if (max1 > max2)
      l = mid;
    else
      h = mid;
  }
  printf("%.12lf\n", max(max1, max2));
  return 0;
}
