#include <bits/stdc++.h>
using namespace std;
void solve() {
  int t;
  cin >> t;
  while (t--) {
    int i, j, k, n, m, x, y, z, c = 0, cnt = 0, a[2250] = {0};
    string s;
    cin >> n >> x;
    for (i = 1; i <= n; i++) {
      cin >> y;
      a[y] = 1;
    }
    for (i = 1;; i++) {
      if (x <= 0) {
        break;
      }
      if (a[i] == 1) {
        continue;
      } else {
        a[i] = 1;
        x = x - 1;
      }
    }
    for (i = 1;; i++) {
      if (a[i] == 0) {
        break;
      }
    }
    cout << i - 1 << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
  return 0;
}
