#include <bits/stdc++.h>
#pragma GCC optimize("-O2")
using namespace std;
template <class T>
inline bool read(T &x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    int ar[n];
    int cr[1123];
    memset(cr, 0, sizeof(cr));
    for (int i = 0; i < n; i++) {
      cin >> ar[i];
      cr[ar[i]] = 1;
    }
    for (int i = 1; i <= 1123; i++) {
      if (x == 0) {
        break;
      }
      if (cr[i] == 0) {
        cr[i] = 1;
        x--;
      }
    }
    int id = 1;
    for (int i = 1; i <= 1123; i++) {
      if (cr[i] == 0) {
        id = i;
        break;
      }
    }
    cout << id - 1 << endl;
    ;
  }
  return 0;
}
