#include <bits/stdc++.h>
using namespace std;
long long n, k, a[2005], dp[2005];
int valid(long long x) {
  for (int i = 1; i <= n; i++) {
    dp[i] = i - 1;
    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);
    if (dp[i] + n - i <= k) return 1;
  }
  return 0;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long lo = 0, hi = 2e9;
  while (lo <= hi) {
    long long mid = lo + (hi - lo) / 2;
    if (valid(mid))
      hi = mid - 1;
    else
      lo = mid + 1;
  }
  cout << lo << endl;
  return 0;
}
