#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
const long long inf = 1e10;
int n, k, a[N];
int dp[N];
bool check(long long x) {
  for (int i = 1; i <= n; ++i) dp[i] = i - 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j < i; ++j) {
      if (abs(a[i] - a[j]) <= x * (i - j))
        dp[i] = min(dp[i], dp[j] + i - j - 1);
    }
    if (dp[i] + n - i <= k) return true;
  }
  return false;
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  long long l = 0, r = inf, mid;
  while (r > l) {
    mid = l + r >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  cout << l << endl;
  return 0;
}
