#include <bits/stdc++.h>
using namespace std;
int mark[205];
int main() {
  int t, n, x, i;
  cin >> t;
  while (t--) {
    cin >> n >> x;
    memset(mark, 0, sizeof(mark));
    int arr[n + 3];
    for (i = 0; i < n; i++) {
      cin >> arr[i];
      mark[arr[i]] = 1;
    }
    for (i = 1;; i++) {
      if (mark[i] == 0) {
        if (x == 0) {
          cout << i - 1 << endl;
          break;
        }
        x--;
      }
    }
  }
  return 0;
}
