import java.util.*;
import java.lang.*;

class Ideone
{   static boolean Cows(int arr[],int dist,int cows){
	   int Cnt=1,last=arr[0];
	   for(int i=1;i<arr.length;i++){
	   	  if(arr[i]-last>=dist){
	   	  	Cnt++;
	   	  	last=arr[i];
	   	  }
	   	  if(Cnt>=cows) return true;
	   }
	   return false;
	   
    }
	static int BS(int arr[],int C,int N){
	      int low=1,high=arr[N-1]-arr[0];
	      while(low<=high){
	      	int mid=(low+high)/2;
	      	if(Cows(arr,mid,C)) low=mid+1;
	      	else high=mid-1;
	      }
	      return high;
    }
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc=new Scanner(System.in);
		int T=sc.nextInt();
		while(T>0){
		int N=sc.nextInt();
		int C=sc.nextInt();
		int arr[]=new int[N];
		for(int i=0;i<N;i++){
			arr[i]=sc.nextInt();
		}
		Arrays.sort(arr);
		System.out.println(BS(arr,C,N));
		T--;
		}
	}
}