#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000 + 23;
int n, a[MAXN], k;
long long dp[MAXN];
bool isval(long long x) {
  for (int i = 0; i < n; i++) {
    dp[i] = i;
    for (int j = 0; j < i; j++)
      if (abs(a[i] - a[j]) <= ((i - j) * x))
        dp[i] = min(dp[j] + (i - j - 1), dp[i]);
    if (dp[i] + (n - i - 1) <= k) return true;
  }
  return false;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long dw = -1, up = INT_MAX;
  while (up - dw > 1) {
    long long mid = ((up + dw) >> 1);
    if (isval(mid))
      up = mid;
    else
      dw = mid;
  }
  cout << up;
  return 0;
}
