#include <bits/stdc++.h>
using namespace std;
int t, ans, x, n, p;
set<int> s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n >> x;
    int a[333] = {0};
    while (n--) {
      cin >> p;
      a[p]++;
    }
    int i = 0;
    while (true) {
      if (a[i + 1])
        i++;
      else {
        if (x == 0)
          break;
        else {
          i++;
          x--;
        }
      }
    }
    cout << i << '\n';
  }
}
