#include <bits/stdc++.h>
using namespace std;
const int N = 2000 + 10;
long long n, a[N], k;
bool solve(long long x) {
  int dp[N];
  for (int i = 0; i <= n; i++) dp[i] = i;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      if (abs(a[i] - a[j]) <= (i - j) * x)
        dp[i] = min(dp[i], dp[j] + i - j - 1);
    }
  }
  long long ans = n;
  for (int i = 1; i <= n; i++) ans = min(ans, dp[i] + n - i - 1);
  return ans <= k;
}
int main() {
  scanf("%lld%lld", &n, &k);
  long long L = 0, R = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", a + i);
    if (i != 1) R = max(R, abs(a[i] - a[i - 1]));
  }
  if (n < 2) {
    puts("0");
    return 0;
  }
  while (L < R) {
    long long mid = L + R >> 1;
    if (solve(mid))
      R = mid;
    else
      L = mid + 1;
  }
  printf("%lld\n", R);
  return 0;
}
