#include <bits/stdc++.h>
using namespace std;
const int INF = 2121212121;
int N, K;
int A[2020];
int dp[2020];
bool test(int c) {
  for (int i = 0; i < 2020; i++) dp[i] = INF;
  int nofix = -INF;
  for (int i = 1; i <= N; i++) {
    if (i > 1) nofix = max(nofix, abs(A[i] - A[i - 1]));
    if (nofix <= c)
      dp[i] = i;
    else {
      dp[i] = 1;
      for (int j = 1; j < i; j++) {
        if ((abs(A[i] - A[j]) + (i - j - 1)) / (i - j) > c) continue;
        dp[i] = max(dp[i], dp[j] + 1);
      }
    }
  }
  int ans = -INF;
  for (int i = 1; i <= N; i++) ans = max(ans, dp[i]);
  if (ans < K) return false;
  return true;
}
int main() {
  cin >> N >> K;
  K = N - K;
  for (int i = 1; i <= N; i++) cin >> A[i];
  int low = -1, high = INF;
  while (low + 1 < high) {
    int mid = low + (high - low) / 2;
    if (!test(mid)) {
      low = mid;
    } else
      high = mid;
  }
  cout << high;
}
