#include <bits/stdc++.h>
using namespace std;
const int maxn = 20000;
int n, k;
long long a[maxn];
int dp[maxn];
inline long long ABS(long long x) {
  if (x < 0) return -x;
  return x;
}
inline bool ok(long long c) {
  memset(dp, 0, sizeof dp);
  for (int i = 1; i <= n; i++) {
    dp[i] = i;
    for (int j = 1; j < i; j++) {
      if (ABS(a[i] - a[j]) <= (long long)(i - j) * c)
        dp[i] = min(dp[i], dp[j] + (i - j - 1));
    }
    if (dp[i] + n - i - 1 <= k) return true;
  }
  return false;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long l = 0, r = 2000000000;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (ok(mid))
      r = mid - 1;
    else
      l = mid + 1;
  }
  cout << l;
  return 0;
}
