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;
const long long MX = 2e5 + 9;
const double eps = 1e-6;
double a[MX];
long long n, nn;
double weak(double x) {
  double cpy[nn];
  for (long long i = 0; i < nn; i++) {
    cpy[i] = a[i] - x;
  }
  double maxx[nn], minn[nn];
  if (cpy[0] > 0) {
    maxx[0] = cpy[0];
    minn[0] = 0;
  } else {
    maxx[0] = 0;
    minn[0] = cpy[0];
  }
  double ans = max(ans, max(maxx[0], -minn[0]));
  for (long long i = 1; i < nn; i++) {
    maxx[i] = max(double(0), maxx[i - 1] + cpy[i]);
    minn[i] = min(double(0), minn[i - 1] + cpy[i]);
    ans = max(ans, max(maxx[i], -minn[i]));
  }
  return ans;
}
double TS(double l, double r) {
  if (r - l < eps) return l;
  double m1 = l + ((r - l) / 3), m2 = r - ((r - l) / 3);
  if (weak(m1) < weak(m2)) {
    return TS(l, m2);
  }
  return TS(m1, r);
}
int32_t main() {
  cin >> n;
  nn = n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  double MN = 10000;
  double ans = TS(-MN, MN);
  cout << "";
  cout << ans << " " << weak(ans);
  return 0;
}
