#include <bits/stdc++.h>
using namespace std;
int t, n, x, k;
int A[10005];
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> x;
    for (int i = 1; i <= 200; i++) A[i] = 0;
    for (int i = 1; i <= n; i++) {
      cin >> k;
      A[k] = 1;
    }
    for (int i = 1; i <= 200; i++)
      if (x) {
        if (!A[i]) {
          A[i] = 1;
          x--;
        }
      }
    int j = 0;
    for (int i = 1; i <= 200; i++) {
      if (!A[i]) break;
      j++;
    }
    cout << j << '\n';
  }
  return 0;
}
