#include <bits/stdc++.h>
using namespace std;
void fio() {}
void pti() {
  double timeuse = clock() * 1000.0 / CLOCKS_PER_SEC;
  cerr << "Timeuse " << timeuse << "ms" << endl;
}
void end() { exit(0); }
namespace io {
const int SIZ = 55;
int que[SIZ], op, qr;
char ch;
template <class I>
inline void gi(I& w) {
  ch = getchar(), op = 1, w = 0;
  while (!isdigit(ch)) {
    if (ch == '-') op = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    w = w * 10 + ch - '0';
    ch = getchar();
  }
  w *= op;
}
template <typename T, typename... Args>
inline void gi(T& t, Args&... args) {
  gi(t);
  gi(args...);
}
template <class I>
inline void print(I w) {
  qr = 0;
  if (!w) putchar('0');
  if (w < 0) putchar('-'), w = -w;
  while (w) que[++qr] = w % 10 + '0', w /= 10;
  while (qr) putchar(que[qr--]);
}
}  // namespace io
using io::gi;
using io::print;
const int N = 205;
int T;
int n, x;
bool vis[N];
int main() {
  fio();
  gi(T);
  while (T--) {
    gi(n, x);
    memset(vis, 0, sizeof(vis));
    for (int i = 1, z; i <= n; ++i) gi(z), vis[z] = true;
    for (int i = 1; i <= 201; ++i) {
      if (vis[i]) continue;
      if (!x) {
        print(i - 1), putchar(10);
        break;
      }
      --x;
    }
  }
  end();
}
