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, a[200000 + 3];
double prefix[200000 + 3];
pair<double, double> getWeakness(double x) {
  prefix[0] = 0;
  for (int i = 1; i <= N; i++) prefix[i] = prefix[i - 1] + (a[i] - x);
  double minPrefix = 0, maxPrefix = 0;
  double maxF = -1e10, maxG = -1e10;
  for (int j = 1; j <= N; j++) {
    double F = prefix[j] - minPrefix;
    double G = -prefix[j] + maxPrefix;
    maxF = max(maxF, F);
    maxG = max(maxG, G);
    minPrefix = min(minPrefix, prefix[j]);
    maxPrefix = max(maxPrefix, prefix[j]);
  }
  return {maxF, maxG};
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) scanf("%d", &a[i]);
  double lo = -10000, hi = 10000, mid;
  for (int rep = 1; rep <= 100; rep++) {
    mid = (lo + hi) / 2.0;
    auto weakness = getWeakness(mid);
    if (weakness.first > weakness.second)
      lo = mid;
    else
      hi = mid;
  }
  auto weakness = getWeakness(lo);
  printf("%.10lf\n", max(weakness.first, weakness.second));
}
