#include <bits/stdc++.h>
using namespace std;
int n, k;
int a[2005];
int dp[2005];
bool check(long long v) {
  int i, j;
  memset(dp, 0x3f, sizeof(dp));
  dp[0] = 0;
  for (i = 1; i < n; ++i) {
    for (j = 0; j < i; ++j)
      if (abs(a[i] - a[j]) * 1LL <= v * (i - j))
        dp[i] = min(dp[i], dp[j] + i - j - 1);
    dp[i] = min(dp[i], i);
  }
  int ans = 0x3f3f3f3f;
  for (i = 0; i < n; ++i) ans = min(ans, dp[i] + n - 1 - i);
  return ans <= k;
}
int main() {
  scanf("%d%d", &n, &k);
  if (n == 1 || n == 0) {
    puts("0");
    return 0;
  }
  int i;
  for (i = 0; i < n; ++i) scanf("%d", a + i);
  long long l = 0, r = 1LL << 35, mid, ans = -1;
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid)) {
      ans = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  if (ans == -1)
    while (1)
      ;
  printf("%I64d\n", ans);
  return 0;
}
