#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, x, i, p = 0;
    cin >> n >> x;
    long long int done[1000] = {0};
    for (i = 0; i < n; i++) {
      long long int y;
      cin >> y;
      done[y] = 1;
    }
    for (i = 1; i <= 1000; i++) {
      if (x == 0) break;
      if (done[i] == 0) x--;
    }
    while (done[i] == 1) i++;
    cout << i - 1 << "\n";
  }
  return 0;
}
