#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, r, k, i, x, a[1000];
  cin >> t;
  while (t--) {
    cin >> n >> x;
    for (i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    for (k = n + x; k >= 1; k--) {
      r = 0;
      for (i = 1; i <= k; i++) {
        if (!binary_search(a, a + n, i)) r++;
      }
      if (r == x) break;
    }
    cout << k << endl;
  }
  return 0;
}
