#include <bits/stdc++.h>
using namespace std;
const int N = 2222;
int n, k;
int a[N];
int dp[N];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  long long l = -1, r = (long long)2000000000 + 100;
  while (r - l > 1) {
    long long m = (l + r) >> 1;
    for (int i = 0; i < n; i++) {
      dp[i] = i;
      for (int last = 0; last < i; last++) {
        int dist = (a[i] - a[last]);
        if (dist < 0) dist = -dist;
        if (m == 0) {
          if (dist == 0) {
            dp[i] = min(dp[i], dp[last] + (i - last - 1));
          }
        } else {
          int cnt = 1 + (dist - 1) / m;
          int free_c = i - last;
          if (cnt <= free_c) {
            if (dp[i] > free_c - 1 + dp[last]) {
              dp[i] = free_c - 1 + dp[last];
            }
          }
        }
      }
    }
    bool ok = false;
    for (int last = 0; last < n; last++)
      if (dp[last] + (n - last - 1) <= k) {
        ok = true;
        break;
      }
    if (ok) {
      r = m;
    } else {
      l = m;
    }
  }
  cout << r << endl;
}
