package demo;
import java.util.Scanner;

public class Main {
  
  
  private static int maxLen(int arr[],int m,int n){
    if(m>=n) return 100;//补交卡的数量大于缺交天数的数量的话,连续的天数肯定是100天,因为如果你只缺了一天然后补交卡大于一的话,连续的天数肯定是100
    int res = arr[m]-1;//拿到的数据是第二个
    for(int i=0;i+m+1<n;i++){
      res = Math.max(res, arr[i+m+1]-arr[i]-1);
    }
    res = Math.max(res, 100-arr[n-m-1]);
    return res;
  }
  
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
/*    Scanner sc = null;
    try {
      sc = new Scanner(new FileInputStream("C:\\Users\\ddguo\\Desktop\\input.txt"));
    } catch (FileNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }*/
    
    int num = sc.nextInt();
    while(num-->0){
      int n = sc.nextInt();//缺交天数的数量
      int m = sc.nextInt();//补交卡数量
      int arr[] = new int[n];
      for(int i=0;i<n;i++){
        arr[i]= sc.nextInt();
      }
      System.out.println(maxLen(arr, m, n));
    }
    sc.close();
  }
}