#include <bits/stdc++.h>
using namespace std;
long ar[1006];
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> ar[i];
  sort(ar, ar + n);
  int ansd, ansa;
  long maxd = ar[n - 1] - ar[0];
  int ans = maxd + 1;
  for (int d = 0; d <= maxd; d++) {
    long maxf = 0, maxs = 0;
    for (int i = 1; i < n; i++) {
      int cur = ar[0] + d * i;
      maxf = max(maxf, cur - ar[i]);
      maxs = max(maxs, ar[i] - cur);
    }
    int na = abs(maxs + maxf + 1) / 2;
    if (na < ans) {
      ans = na;
      ansd = d;
      if (maxs > maxf)
        ansa = ar[0] - na + maxs;
      else
        ansa = ar[0] + na - maxf;
    }
  }
  cout << ans << endl;
  cout << ansa << ' ' << ansd;
  return 0;
}
