#include <bits/stdc++.h>
using namespace std;
int n, k;
long long A[2009];
int solve(long long m) {
  long long dp[2009] = {0};
  for (int i = 0; i < n; i++) {
    dp[i] = i;
    for (int j = 0; j < i; j++)
      if (abs(A[i] - A[j]) <= m * (i - j))
        dp[i] = min(dp[i], dp[j] + i - j - 1);
  }
  long long ans = n;
  for (int i = 0; i < n; i++) ans = min(ans, dp[i] + n - i - 1);
  return ans <= k;
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) cin >> A[i];
  long long lo = 0, hi = 2e9;
  while (hi > lo) {
    long long mid = (lo + hi) >> 1;
    if (solve(mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  cout << lo << endl;
  return 0;
}
