#include <bits/stdc++.h>
using namespace std;
int a[2005], b[2005], sum, k, n;
bool ok(int d) {
  for (int i = 1; i <= n; i++) b[i] = 1;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      if (abs(a[i] - a[j]) <= (long long)(i - j) * d)
        b[i] = max(b[i], b[j] + 1);
    }
  }
  sum = 0;
  for (int i = 1; i <= n; i++) sum = max(sum, b[i]);
  return n - sum <= k;
}
int main() {
  int l = 0, r = 2 * 1000000000;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  while (l <= r) {
    int Mid = ((long long)l + r) / 2;
    if (ok(Mid))
      r = Mid - 1;
    else
      l = Mid + 1;
  }
  printf("%d\n", l);
  return 0;
}
