#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int TESTS;
  cin >> TESTS;
  while (TESTS--) {
    long long int n, x;
    cin >> n >> x;
    vector<long long int> v(n);
    vector<long long int> t(1000, 0);
    for (long long int i = 0; i < n; i++) {
      cin >> v[i];
    }
    for (long long int i = 0; i < n; i++) {
      t[v[i]] += 1;
    }
    for (long long int i = 1; i < 1000; i++) {
      if (t[i] == 0 && x > 0) {
        t[i] = 1;
        x--;
      } else if (x == 0 && t[i] == 0) {
        cout << i - 1 << "\n";
        break;
      }
    }
  }
  return 0;
}
