#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
using pii = pair<int, int>;
using vi = vector<int>;
signed main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, x;
    scanf("%d %d", &n, &x);
    set<int> st;
    for (int i = 1, a; i <= n; i++) cin >> a, st.insert(a);
    for (int i = 1;; i++)
      if (st.count(i) == 0)
        if (x)
          x--;
        else {
          printf("%d\n", i - 1);
          break;
        }
  }
  fprintf(stderr, "time=%.4f\n", (db)clock() / CLOCKS_PER_SEC);
  return 0;
}
