#include <bits/stdc++.h>
using namespace std;
mt19937 rng(time(0));
uniform_int_distribution<int> uid(-1e9, 1e9);
int mod1 = 4294967291;
int check(vector<long long>& v, long long a, long long d) {
  long long res = 0;
  for (int i = 0; i < v.size(); ++i) res = max(res, abs(v[i] - a - i * d));
  return res;
}
signed main() {
  int n;
  cin >> n;
  vector<long long> v(n);
  for (auto& i : v) cin >> i;
  sort((v).begin(), (v).end());
  long long res = 1e18, a = -2e4, d = 0;
  for (long long ai = -2e4; ai <= 2e4; ++ai) {
    if (abs(v[0] - ai) > res) break;
    int l = 0, r = 2e4, m;
    while (l < r) {
      m = (l + r) / 2;
      if (check(v, ai, m) < check(v, ai, m + 1))
        r = m;
      else
        l = m + 1;
    }
    long long x = check(v, ai, l);
    if (x < res) res = x, a = ai, d = l;
  }
  cout << res << '\n' << a << ' ' << d;
}
