#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000 + 10;
int n, k;
int a[MAXN];
int dp[MAXN];
bool possible(long long x) {
  memset(dp, 0, n);
  for (int i = 0; i < n; i++) {
    dp[i] = i;
    for (int j = 0; 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 - 1 <= k) return true;
  }
  return false;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long s = -1;
  long long e = 2e9 + 10;
  long long mid;
  while (e - s > 1) {
    mid = (s + e) / 2;
    if (possible(mid))
      e = mid;
    else
      s = mid;
  }
  cout << e << endl;
  return 0;
}
