#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2100;
int n, k, dp[MAXN], arr[MAXN];
bool works(long long x) {
  for (int i = 0; i < n; i++) {
    dp[i] = i;
  }
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) {
      if (abs(arr[i] - arr[j]) <= x * (i - j)) {
        dp[i] = min(dp[i], dp[j] + i - j - 1);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (dp[i] + (n - 1 - i) <= k) {
      return true;
    }
  }
  return false;
}
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  long long lo = 0;
  long long hi = 1e10;
  while (lo <= hi) {
    long long mid = (lo + hi) / 2;
    if (works(mid)) {
      hi = mid - 1;
    } else {
      lo = mid + 1;
    }
  }
  printf("%I64d\n", lo);
  return 0;
}
