#include <bits/stdc++.h>
using namespace std;
int n, K, A[2005], dp[2005];
bool okok(int d) {
  for (int i = 1; i <= n; ++i) {
    dp[i] = i - 1;
    for (int j = i - 1; j; --j)
      if (abs(A[i] - A[j]) <= (long long)d * (i - j))
        dp[i] = min(dp[i], dp[j] + i - j - 1);
    if (dp[i] + n - i <= K) return 1;
  }
  return 0;
}
int main(int argc, char const *argv[]) {
  cin >> n >> K;
  int l = 0, r = (int)2e9, mid;
  for (int i = 1; i <= n; ++i) {
    cin >> A[i];
  }
  while (l < r) {
    mid = l + ((r - l) >> 1);
    if (okok(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << l << endl;
}
