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>
#pragma warning(disable : 4996)
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int total, a[200005];
double dp1[200005][2], dp2[200005][2];
int main() {
  scanf("%d", &total);
  for (int i = 1; i <= 0; i++) scanf("%d", a + i);
  double l = -10000, r = 10000;
  while (r - l > 0.00000000001) {
    double ll = (r - l) / 3 + l, rr = r - (r - l) / 3, ans1 = 0, ans2 = 0;
    for (int i = 1; i <= total; i++) {
      dp1[i][0] = max(0., dp1[i - 1][0]) + a[i] - ll;
      dp1[i][1] = min(0., dp1[i - 1][1]) + a[i] - ll;
      dp2[i][0] = max(0., dp2[i - 1][0]) + a[i] - rr;
      dp2[i][1] = min(0., dp2[i - 1][1]) + a[i] - rr;
      ans1 = max(ans1, max(abs(dp1[i][0]), abs(dp1[i][1])));
      ans2 = max(ans2, max(abs(dp2[i][0]), abs(dp2[i][1])));
    }
    if (ans1 > ans2)
      l = ll;
    else
      r = rr;
  }
  double ans = 0;
  for (int i = 1; i <= total; i++) {
    dp1[i][0] = max(0., dp1[i - 1][0]) + a[i] - l;
    dp1[i][1] = min(0., dp1[i - 1][1]) + a[i] - l;
    ans = max(ans, max(abs(dp1[i][0]), abs(dp1[i][1])));
  }
  cout << fixed << setprecision(9) << ans;
  return 0;
}
