#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5;
long long a[N], dp[N];
long long n, k;
long long check(long long m) {
  for (int i = 0; i < n; i++) {
    dp[i] = i - 1;
    for (int j = 0; j < i; j++) {
      if (abs(a[i] - a[j]) <= 1ll * (i - j) * m) {
        dp[i] = min(dp[i], dp[j] + i - j - 1);
      }
    }
    if (dp[i] + n - i <= k) {
      return true;
    }
  }
  return false;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long l = -1, r = 2e9;
  while (r - l > 1) {
    long long mid = (l + r) / 2;
    if (check(mid)) {
      r = mid;
    } else {
      l = mid;
    }
  }
  cout << r;
}
