#include <bits/stdc++.h>
using namespace std;
int n, k;
long long arr[2007], dp[2007];
long long ans;
int suck(long long x) {
  long long fuck = -1;
  for (int i = 1; i <= n; i++) {
    dp[i] = 1;
    for (int j = 1; j < i; j++)
      if (abs(arr[j] - arr[i]) <= x * abs(i - j)) dp[i] = max(dp[i], dp[j] + 1);
    fuck = max(fuck, dp[i]);
  }
  return fuck + k >= n;
}
void sol(long long l, long long r) {
  if (l > r) return;
  long long mid = (l + r) / 2;
  if (suck(mid)) {
    ans = mid;
    sol(l, mid - 1);
  } else
    sol(mid + 1, r);
}
int main() {
  scanf("%d%d", &n, &k);
  long long shit = -1e9;
  scanf("%lld", &arr[1]);
  for (int i = 2; i <= n; i++) {
    scanf("%lld", &arr[i]);
    shit = max(shit, abs(arr[i] - arr[i - 1]));
  }
  sol(0ll, shit);
  printf("%lld", ans);
}
