#include <bits/stdc++.h>
using namespace std;
long long par[1000005], siize[1000005];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n, i, j, k, x;
    cin >> n >> k;
    long long ar[1000];
    memset(ar, 0, sizeof(ar));
    for (i = 0; i < n; i++) {
      cin >> x;
      ar[x] = 1;
    }
    for (i = 1; i <= 1000; i++) {
      if (k == 0)
        break;
      else if (ar[i] == 0) {
        ar[i] = 1;
        k--;
      }
    }
    for (i = 1; i <= 1000; i++)
      if (ar[i] == 0) {
        cout << i - 1 << '\n';
        break;
      }
  }
  return 0;
}
