#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  if (fopen("input.txt", "r"))
    freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  ios::sync_with_stdio(0), cin.tie(0);
  long long T;
  cin >> T;
  while (T--) {
    long long n, x;
    cin >> n >> x;
    long long a[510] = {0};
    for (long long i = 0; i < n; i++) {
      long long b;
      cin >> b;
      a[b] = 1;
    }
    long long i = 1, ans = 1;
    for (long long i = 1; i < 510; i++) {
      if (a[i] == 0 and x == 0) break;
      if (a[i] == 0) x--;
      ans = max(i, ans);
    }
    cout << ans << endl;
  }
}
