#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize(3)
void solve() {
  int n, x;
  cin >> n >> x;
  int p[300];
  memset(p, 0, sizeof(p));
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    p[a] = 1;
  }
  int v;
  for (v = 1; x >= 0; v++) {
    if (!p[v]) {
      if (x > 0)
        x--;
      else
        break;
    }
  }
  (cout << (v - 1) << "\n");
}
int main() {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
