#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    vector<int> v(n);
    unordered_map<int, int> m;
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      m[v[i]]++;
    }
    int i = 1;
    while (x) {
      if (m[i]) {
        i++;
        continue;
      }
      m[i]++;
      i++;
      x--;
    }
    int ans = -1;
    i = 1;
    while (true) {
      if (!m[i]) break;
      ans = i;
      i++;
    }
    cout << ans << endl;
  }
}
