#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
const double PI = acos(-1);
const int MAXN = 1e5 + 10;
int n, T, m, k, x;
char str[10];
int a[205];
int vis[205];
void solve() {
  int idx = 1;
  int ans = 0;
  while (x >= 0 && idx <= 200) {
    if (vis[idx]) {
      ans++;
    } else if (x == 0) {
      break;
    } else {
      x--;
      ans++;
    }
    idx++;
  }
  printf("%d\n", ans);
}
void init() {
  memset(vis, 0, sizeof(vis));
  scanf("%d%d", &n, &x);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    vis[a[i]] = 1;
  }
}
int main() {
  scanf("%d", &T);
  while (T--) {
    init();
    solve();
  }
  return 0;
}
