#include <bits/stdc++.h>
using namespace std;
int read(int ret = 0, int mark = 1, char c = getchar()) {
  while (!isdigit(c)) {
    if (c == '-') mark = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    ret = (ret << 3) + (ret << 1) + c - '0';
    c = getchar();
  }
  return ret * mark;
}
const int N = 10005;
int t, n, x;
bool a[N];
int main() {
  t = read();
  while (t--) {
    n = read(), x = read();
    memset(a, 0, sizeof(a));
    int v = 1;
    for (int i = 1; i <= n; ++i) {
      a[read()] = 1;
    }
    for (int j = 0; v <= 200; ++v) {
      if (!a[v]) {
        if (j == x)
          break;
        else
          j++;
      }
    }
    printf("%d\n", v - 1);
  }
}
