#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    int ar[n];
    int aux[505];
    memset(aux, 0, sizeof aux);
    for (int i = 0; i < n; i++) {
      cin >> ar[i];
      aux[ar[i]] = 1;
    }
    int idx = 1;
    while (x > 0) {
      if (aux[idx] == 0) {
        aux[idx] = 1;
        x--;
      }
      idx++;
    }
    while (aux[idx] != 0) {
      idx++;
    }
    cout << idx - 1 << "\n";
  }
  return 0;
}
