#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5;
int a[N], dp[N], n, k;
bool check(int x) {
  for (int i = 1; i <= n; ++i) {
    dp[i] = i - 1;
    for (int j = 1; j < i; ++j) {
      if (1ll * abs(a[i] - a[j]) <= 1ll * (i - j) * x)
        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 = 2e9, ret;
  while (l < r) {
    int m = l + r >> 1;
    if (check(m))
      r = m;
    else
      l = m + 1;
  }
  printf("%lld\n", l);
  return 0;
}
