#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e3 + 5;
long long a[MAXN];
long long d[MAXN];
long long dp[MAXN];
int n, k;
bool judge(long long t) {
  for (int i = 1; i <= n; i++) {
    dp[i] = i - 1;
    for (int m = 1; m < i; m++)
      if (abs(a[i] - a[m]) <= (i - m) * t) {
        dp[i] = min(dp[i], dp[m] + i - m - 1);
      }
    if (dp[i] + n - i <= k) return true;
  }
  return false;
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  if (n == 1 && k == 1) {
    printf("0\n");
    return 0;
  }
  for (int i = 1; i <= n - 1; i++) {
    d[i] = abs(a[i + 1] - a[i]);
  }
  sort(d + 1, d + n);
  long long l = 0;
  long long r = d[n - 1];
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (judge(mid)) {
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  printf("%lld\n", l);
  return 0;
}
