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> v;
int n;
double arr[200100];
int main() {
  cin >> n;
  int temp1;
  for (int i = int(1); i <= int(n); i++) {
    cin >> temp1;
    v.push_back(temp1);
    arr[i] = temp1;
  }
  sort(v.begin(), v.end());
  double a = *v.begin();
  vector<int>::iterator it = v.end();
  it--;
  double b = *it;
  double cikar = (a + b) / 2;
  for (int i = int(1); i <= int(n); i++) {
    arr[i] -= cikar;
  }
  double posmax = arr[1];
  double possum = arr[1];
  for (int i = int(2); i <= int(n); i++) {
    possum = max(arr[i] + possum, arr[i]);
    posmax = max(posmax, possum);
  }
  double negmax = -arr[1];
  double negsum = -arr[1];
  for (int i = int(2); i <= int(n); i++) {
    negsum = max(-arr[i] + negsum, -arr[i]);
    negmax = max(negmax, negsum);
  }
  printf("%.12f\n", max(negmax, posmax));
  return 0;
}
