#include <bits/stdc++.h>
using namespace std;
const int MAX = 2005;
long long n, t, a[MAX], dp[MAX];
bool check(long long k) {
  for (int i = 0; i < MAX; i++) dp[i] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < i; j++)
      if ((long long)abs(a[i] - a[j]) <= (i - j) * k)
        dp[i] = max(dp[i], dp[j] + 1);
  long long ans = 0;
  for (int i = 0; i < n; i++) ans = max(ans, dp[i]);
  return (ans >= n - t);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> t;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long left = 0, right = 1e15;
  while (left < right) {
    long long mid = (left + right) / 2;
    if (check(mid))
      right = mid;
    else
      left = mid + 1;
  }
  cout << left;
  return 0;
}
