#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2e3 + 10;
const long long INF = 1e12 + 10;
long long a[MAXN];
long long dp[MAXN];
long long n, k;
long long f(long long t) {
  long long res = 0;
  for (long long i = 1; i <= n; i++) {
    dp[i] = 1;
    for (long long j = i - 1; j >= 1; j--) {
      if (abs(a[i] - a[j]) <= (i - j) * t) {
        dp[i] = max(dp[i], dp[j] + 1);
      }
    }
    res = max(res, dp[i]);
  }
  return res;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long l = -1, r = INF;
  while (true) {
    if (r - l == 1) {
      cout << r;
      return 0;
    }
    long long mid = (l + r) / 2;
    if (f(mid) >= (n - k)) {
      r = mid;
    } else {
      l = mid;
    }
  }
}
