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 eps = 1e-10;
int data[200010];
double dp[200010][2];
int n;
double calc(double x) {
  dp[0][0] = dp[0][1] = 0;
  double ans0 = 0, ans1 = 0;
  for (int i = 1; i <= n; ++i) {
    dp[i][0] = max(dp[i - 1][0] + data[i] - x, data[i] - x);
    dp[i][1] = min(dp[i - 1][1] + data[i] - x, data[i] - x);
    ans0 = max(ans0, dp[i][0]);
    ans1 = min(ans1, dp[i][1]);
  }
  return max(fabs(ans0), fabs(ans1));
}
int main() {
  scanf("%d", &n);
  double l = 11000, r = -11000;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", data + i);
    l = min(l, (double)data[i]);
    r = max(r, (double)data[i]);
  }
  while (r - l > eps) {
    double mid2 = r * 2 / 3 + l / 3, mid1 = l * 2 / 3 + r / 3;
    if (calc(mid1) > calc(mid2))
      l = mid1;
    else
      r = mid2;
  }
  printf("%f\n", calc(l));
  return 0;
}
