#include <bits/stdc++.h>
using namespace std;
const int N = 2009;
long long a[N];
long long dp[N];
long long n, k;
long long LLabs(long long x) { return x > 0LL ? x : -x; }
bool check(long long mid) {
  dp[1] = 0;
  for (int i = 2; i <= n; ++i) {
    dp[i] = i - 1;
    for (int j = 1; j < i; ++j) {
      if (LLabs(a[i] - a[j]) <= mid * (i - j))
        dp[i] = min(dp[i], dp[j] + (i - j - 1));
    }
  }
  for (int i = 1; i <= n; ++i) {
    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 L = 0, R = 2e9;
  long long ans = 0;
  while (L <= R) {
    long long mid = (L + R) >> 1;
    if (check(mid))
      R = mid - 1, ans = mid;
    else
      L = mid + 1;
  }
  cout << ans << endl;
  return 0;
}
