#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long a, b, arr[400], temp;
    cin >> a >> b;
    memset(arr, 0, sizeof(arr));
    for (int i = 0; i < a; i += 1) {
      cin >> temp;
      arr[temp] = 1;
    }
    long long count = 0;
    for (long long i = 1;; i++) {
      if (arr[i] == 0 && b) {
        arr[i] = 1;
        b--;
      }
      if (arr[i] == 0 && b == 0) {
        break;
      }
      count++;
    }
    cout << count << "\n";
  }
  return 0;
}
