#include <bits/stdc++.h>   using namespace std;   int n, k, A[2005], DP[2005];   inline int ok(int X) {     memset(DP, 0, sizeof(DP));     int i, j;     long long l1, r1, l2, r2;     for (i = 1; i <= n; i++) DP[i] = i - 1;     for (i = 2; i <= n; i++)       if (abs(A[i] - A[i - 1]) <= X)         DP[i] = 0;       else         break;     for (i = 1; i <= n; i++)       for (j = i + 1; j <= n; j++) {         l1 = (long long)A[i] - (long long)X * (j - i - 1);         r1 = (long long)A[i] + (long long)X * (j - i - 1);         l2 = A[j] - X;         r2 = A[j] + X;         if (!(l2 > r1 || l1 > r2)) DP[j] = min(DP[j], DP[i] + j - i - 1);       }     for (i = 1; i <= n; i++)       if (DP[i] + n - i <= k) return 1;     return 0;   }   int cbin() {     int i, step = (1 << 30);     for (i = -1; step; step >>= 1)       if (!ok(i + step)) i += step;     return ++i;   }   int main() {     scanf( %d%d , &n, &k);     int i;     for (i = 1; i <= n; i++) scanf( %d , &A[i]);     printf( %d n , cbin());     return 0;   }   