#include <bits/stdc++.h>
using namespace std;
int n, k, a[2001];
bool check(long long h) {
  vector<pair<long long, long long>> rank;
  for (int i = 1; i <= n; ++i)
    rank.push_back(make_pair(h * i - a[i], h * i + a[i]));
  sort(rank.begin(), rank.end());
  vector<long long> existing;
  for (size_t i = 0; i < rank.size(); ++i) {
    size_t pos = upper_bound(existing.begin(), existing.end(), rank[i].second) -
                 existing.begin();
    if (pos == existing.size())
      existing.push_back(rank[i].second);
    else
      existing[pos] = rank[i].second;
  }
  return int(existing.size()) >= n - k;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  long long l = 0, r = 2000000000;
  while (l < r) {
    long long m = (l + r) / 2;
    if (check(m))
      r = m;
    else
      l = m + 1;
  }
  printf("%lld", l);
  return 0;
}
