#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const double eps = 1e-9;
const int maxN = 2 * 1024;
int N, K;
long long arr[maxN];
int dp[maxN];
bool eval(long long ugly) {
  for (int k = (0); k < (K + 1); k++) dp[k + 1] = k;
  for (int p = (1); p < (N + 1); p++) {
    dp[p] = p - 1;
    long long diff = ugly;
    for (int q = int(p) - 1; q >= (1); q--) {
      if (abs(arr[p] - arr[q]) <= diff) dp[p] = min(dp[p], dp[q] + p - q - 1);
      diff += ugly;
    }
  }
  for (int k = (0); k < (K + 1); k++) {
    if (dp[N - k] + k <= K) return true;
  }
  return false;
}
int main() {
  cin >> N >> K;
  for (int i = (1); i < (N + 1); i++) cin >> arr[i];
  if (N <= 1) {
    cout << 0 << endl;
    return 0;
  }
  long long a = 0, b = 2e9 + 1;
  while (a < b) {
    long long m = a + (b - a) / 2;
    if (eval(m))
      b = m;
    else
      a = m + 1;
  }
  cout << a << endl;
}
