#include <bits/stdc++.h>
using namespace std;
const int maxn = 2010;
long long a[maxn];
int n, k;
int dp[maxn];
bool check(long long xx) {
  dp[0] = 0;
  for (int i = 1; i <= n; i++) dp[i] = n + 3;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      if (abs(a[i] - a[j]) <= xx * (i - j))
        dp[i] = min(dp[i], i - j - 1 + dp[j]);
    }
    dp[i] = min(dp[i], i - 1);
  }
  for (int i = 1; i <= n; i++)
    if (k - dp[i] >= n - i) return true;
  return false;
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  long long L = 0, R = 0, M;
  for (int i = 1; i < n; i++) R = max(R, abs(a[i] - a[i + 1]));
  while (L < R) {
    M = L + (R - L) / 2;
    if (check(M))
      R = M;
    else
      L = M + 1;
  }
  printf("%I64d\n", R);
  return 0;
}
