#include <bits/stdc++.h>
using namespace std;
int n, k, a[2001], dp[2001];
bool check(int c) {
  int res = INT_MAX;
  for (int i = 1; i <= n; i++) {
    dp[i] = i - 1;
    for (int j = 1; j < i; j++)
      if (abs(a[i] - a[j]) <= 1ll * c * (i - j))
        dp[i] = min(dp[j] + i - j - 1, dp[i]);
    res = min(dp[i] + n - i, res);
  }
  return (res <= k);
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  long long l = 0, r = 2 * (1e9) + 10;
  while (l < r) {
    int mid = l + r >> 1;
    if (check(mid))
      r = mid;
    else
      l = mid + 1;
  }
  printf("%lld", l);
}
