#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
const long long int INF = 1e18;
const long long int N = 1e6 + 1;
vector<long long int> g[N];
void solve() {
  long long int n, x;
  cin >> n >> x;
  long long int a[n];
  map<long long int, long long int> vis;
  for (long long int &it : a) {
    cin >> it;
    vis[it] = 1;
  }
  long long int cnt = 0;
  long long int ans;
  for (long long int i = 1; i <= 1000; i++) {
    if (!vis[i]) {
      if (cnt < x) {
        vis[i] = 1;
        ans = i;
        cnt++;
      } else {
        break;
      }
    } else {
      ans = i;
    }
  }
  cout << ans << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int tc = 1;
  cin >> tc;
  while (tc--) {
    solve();
  }
}
