#include <bits/stdc++.h>
using namespace std;
long long dp[2005];
long long a[2005];
long long n, k;
long long check(long long mid) {
  memset(dp, 0x3f3f3f3f, sizeof(dp));
  dp[1] = 0;
  for (long long i = 2; i <= n; i++) {
    dp[i] = i - 1;
    for (long long j = i - 1; j >= 1; j--) {
      if (abs(a[i] - a[j]) <= mid * (i - j)) {
        dp[i] = min(dp[i], dp[j] + i - j - 1);
      }
    }
    if (dp[i] + n - i <= k) return 1;
  }
  return dp[n] <= k;
}
int main() {
  while (~scanf("%I64d%I64d", &n, &k)) {
    for (long long i = 1; i <= n; i++) {
      scanf("%I64d", &a[i]);
    }
    long long l = 0, r = 2000000050;
    long long ans = 0;
    while (r >= l) {
      long long mid = (l + r) / 2;
      if (check(mid)) {
        r = mid - 1;
        ans = mid;
      } else
        l = mid + 1;
    }
    printf("%I64d\n", ans);
  }
}
