#include<bits/stdc++.h>
using namespace std;
#define MAX_N 100005
int N,M;
int s[MAX_N];

int check(int X){
  int res=0;
  int lv=1;
  int p=0;
  while( lv + X <= s[N-1] ){
    while(p+1<N&&s[p]<=lv)p++;
    
    int f=p;
    if( s[f] >= lv + X)f--;
    if(f>0 && abs(s[f]-lv) > abs(s[f-1]-lv) )f--;
    if(f<0)return 1e9;
    res++;
    lv+=max(1, X-abs(s[f]-lv));
  }
  return res+1;
}

int solve(){
  int left=s[0];
  int right=1e9;
  int mid;
  while(right-left>1){
    mid=(left+right)/2;
    if(check(mid) >= M){
      left=mid;
    }else{
      right=mid;
    }
  }

  
  if(check(left)>=M)return left;
  else return -1;
}

int main(){
  while(1){
    scanf("%d %d",&N,&M);
    if(N==0&&M==0)break;
    for(int i=0;i<N;i++)scanf("%d",&s[i]);
    cout<<solve()<<endl;
  }
  return 0;
}