#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000;
int n, k;
int a[MAXN];
int mem[MAXN];
int countChanges(int pos, int d) {
  if (pos == -1) {
    int ret = n;
    for (int i = 0; i < n; ++i) ret = min(ret, countChanges(i, d) + i);
    return ret;
  }
  if (mem[pos] != -1) return mem[pos];
  int ret = n - pos - 1;
  for (int i = pos + 1; i < n; ++i)
    if (abs(a[i] - a[pos]) <= (i - pos) * (long long)d)
      ret = min(ret, countChanges(i, d) + i - pos - 1);
  return mem[pos] = ret;
}
int main(void) {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  int lo = 0, hi = 2e+9, mid;
  while (lo < hi) {
    mid = ((long long)lo + hi) / 2;
    memset(mem, -1, sizeof mem);
    if (countChanges(-1, mid) <= k)
      hi = mid;
    else
      lo = mid + 1;
  }
  printf("%d\n", lo);
  return 0;
}
