#include <bits/stdc++.h>
using namespace std;
bool arr[1006] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int tc;
  cin >> tc;
  while (tc--) {
    memset(arr, 0, sizeof arr);
    int n, x, a;
    cin >> n >> x;
    for (int i = 0; i < n; i++) {
      cin >> a;
      arr[a] = 1;
    }
    int cnt = 0;
    ;
    a = x;
    for (int i = 1; x != 0; i++) {
      if (arr[i] == 0) {
        arr[i] = 1;
        x--;
      }
    }
    for (int i = 1;; i++) {
      if (arr[i] == 0) {
        break;
      } else
        cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}
