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